201036 PDK_4.0.a
authorhgs
Thu, 23 Sep 2010 17:06:47 +0300
changeset 48 22de2e391156
parent 35 14e279d2bbb7
child 51 20ac952a623c
201036
atext/client/group/extclient.mmp
atext/client/group/extcommon.mmp
atext/plugins/legacymodemplugin/group/legacymodemplugin.mmp
atext/plugins/legacymodemplugin/src/2002B340.rss
atext/server/group/atextcommonbase.mmp
atext/server/group/atextpluginbase.mmp
atext/server/group/extsrv.mmp
atext/server/group/extsrvcommon.mmp
bluetooth/btexample/example/btproperties/BTProperties.cpp
bluetooth/btextnotifiers/bld.inf
bluetooth/btextnotifiers/inc/BTExtNotifiers.h
bluetooth/btlogger/btsnoophcilogger/group/bld.inf
bluetooth/btlogger/generic/group/bld.inf
bluetooth/btsdp/bld.inf
bluetooth/btsdp/server/protocol/listener.cpp
bluetooth/btstack/HCIShared/group/bld.inf
bluetooth/btstack/bld.inf
bluetooth/btstack/bluetooth_stack.ini
bluetooth/btstack/common/bt.h
bluetooth/btstack/common/bt_v2.mmp
bluetooth/btstack/common/btsap.cpp
bluetooth/btstack/inc/BtSap.h
bluetooth/btstack/l2cap/l2capSAPSignalHandler.cpp
bluetooth/btstack/l2cap/l2capSAPSignalHandler.h
bluetooth/btstack/l2cap/l2capSigStates.cpp
bluetooth/btstack/l2cap/l2sapstates.cpp
bluetooth/btstack/l2cap/l2sapstates.h
bluetooth/btstack/linkmgr/MBtHostControllerEventInternalNotifier.h
bluetooth/btstack/linkmgr/PhysicalLinkHelper.cpp
bluetooth/btstack/linkmgr/PhysicalLinkHelper.h
bluetooth/btstack/linkmgr/encryptionkeyrefreshhelper.cpp
bluetooth/btstack/linkmgr/encryptionkeyrefreshhelper.h
bluetooth/btstack/linkmgr/hcifacade.cpp
bluetooth/btstack/linkmgr/hcifacade.h
bluetooth/btstack/linkmgr/hcifacade_events.cpp
bluetooth/btstack/linkmgr/hostmbufpool.cpp
bluetooth/btstack/linkmgr/hostresolver.cpp
bluetooth/btstack/linkmgr/hostresolver.h
bluetooth/btstack/linkmgr/linkmgr.cpp
bluetooth/btstack/linkmgr/linkmgr.h
bluetooth/btstack/linkmgr/linkutil.h
bluetooth/btstack/linkmgr/physicallinks.cpp
bluetooth/btstack/linkmgr/physicallinks.h
bluetooth/btstack/linkmgr/physicallinksmanager.cpp
bluetooth/btstack/linkmgr/physicallinksmanager.h
bluetooth/btstack/linkmgr/roleswitchhelper.cpp
bluetooth/btstack/linkmgr/roleswitchhelper.h
bluetooth/btstack/rfcomm/rfcommmuxchannel.h
bluetooth/btstack/rfcomm/rfcommmuxchannel.inl
bluetooth/btstack/rfcomm/rfcommmuxer.cpp
bluetooth/btstack/rfcomm/rfcommstates.cpp
bluetooth/btstack/rfcomm/rfcommutil.h
bluetooth/btstack/sdp/sdpclient.cpp
bluetooth/btstack/sdp/sdpclient.h
bluetooth/btstack/sdp/sdpstackutil.h
bluetooth/btstack/secman/btaccessrequester.cpp
bluetooth/btstack/secman/pairingserver.cpp
bluetooth/btstack/secman/pairingserver.h
bluetooth/btstack/secman/public/pairingservershared.h
bluetooth/btstack/secman/secman.cpp
bluetooth/btstack/secman/secman.h
bluetooth/btstack/test/util/hcemulator/hcemulator.cpp
bluetooth/btstack/test/util/hcemulator/hcemulator.h
bluetooth/gavdp/group/bld.inf
bluetoothcommsprofiles/btpan/group/bld.inf
bluetoothcommsprofiles/btpan/group/bnep.mmp
bluetoothmgmt/bluetoothclientlib/bld.inf
bluetoothmgmt/bluetoothclientlib/inc/a2dpoptimisation.h
bluetoothmgmt/bluetoothclientlib/inc/bt_sock.h
bluetoothmgmt/btcommon/inc/BTSec.h
bluetoothmgmt/btmgr/Inc/btdevice.h
bluetoothmgmt/btmgr/bld.inf
bluetoothmgmt/btmgr/eirclient/group/bld.inf
bluetoothmgmt/btrom/bluetooth.iby
bthci/bthci2/CommandsEvents/group/bld.inf
bthci/bthci2/btpowercontrol/group/bld.inf
bthci/bthci2/dutmode/group/bld.inf
bthci/bthci2/dutmode/interface/dutmode.h
bthci/bthci2/group/bld.inf
bthci/bthci2/group/hci_framework.iby
bthci/bthci2/hcicmdq/group/bld.inf
bthci/bthci2/hciserverclient/group/bld.inf
bthci/bthci2/hciutil/group/bld.inf
bthci/bthci2/hctl/group/bld.inf
bthci/bthci2/initialisor/group/bld.inf
bthci/bthci2/qdp/group/bld.inf
bthci/hci2implementations/CommandsEvents/symbian/group/bld.inf
bthci/hci2implementations/CommandsEvents/symbian/group/commandsevents_symbian.mmp
bthci/hci2implementations/hctls/ti/group/bld.inf
bthci/hciextensioninterface/bld.inf
bthci/hciextensioninterface/tsrc/tproxy.cpp
bthci/hciextensioninterface/tsrc/tproxycorehci/group/bld.inf
bthci/hciextensioninterface/tsrc/tproxycorehci/group/bluetooth_stack.ini
irda/irdastack/group/bld.inf
irda/irdastack/group/irda.iby
--- a/atext/client/group/extclient.mmp	Wed Jul 21 15:42:05 2010 +0300
+++ b/atext/client/group/extclient.mmp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-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"
@@ -31,15 +31,8 @@
 
 USERINCLUDE             ../inc ../../../inc
 
-// Default system include paths for OS extension layer modules.
 OS_LAYER_SYSTEMINCLUDE
 
-// Note:
-// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones.
-// If there is a S60 header in the subdirectory then that should be
-// added into the include statements (like #include <phonebook/header.h>)
-//SYSTEMINCLUDE           /epoc32/include/ecom
-
 LIBRARY                 euser.lib
 
 #ifdef PRJ_FILE_TRACE
--- a/atext/client/group/extcommon.mmp	Wed Jul 21 15:42:05 2010 +0300
+++ b/atext/client/group/extcommon.mmp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-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"
@@ -31,15 +31,8 @@
 
 USERINCLUDE             ../inc
 
-// Default system include paths for OS extension layer modules.
 OS_LAYER_SYSTEMINCLUDE
 
-// Note:
-// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones.
-// If there is a S60 header in the subdirectory then that should be
-// added into the include statements (like #include <phonebook/header.h>)
-//SYSTEMINCLUDE           /epoc32/include/ecom
-
 LIBRARY                 euser.lib
 
 #ifdef PRJ_FILE_TRACE
--- a/atext/plugins/legacymodemplugin/group/legacymodemplugin.mmp	Wed Jul 21 15:42:05 2010 +0300
+++ b/atext/plugins/legacymodemplugin/group/legacymodemplugin.mmp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-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"
@@ -38,13 +38,6 @@
 
 OS_LAYER_SYSTEMINCLUDE
 
-// Note:
-// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones.
-// If there is a S60 header in the subdirectory then that should be
-// added into the include statements (like #include <phonebook/header.h>)
-//SYSTEMINCLUDE           /epoc32/include/ecom
-SYSTEMINCLUDE           /epoc32/include/ecom
-
 LIBRARY ecom.lib
 LIBRARY euser.lib
 LIBRARY atextpluginbase.lib
--- a/atext/plugins/legacymodemplugin/src/2002B340.rss	Wed Jul 21 15:42:05 2010 +0300
+++ b/atext/plugins/legacymodemplugin/src/2002B340.rss	Thu Sep 23 17:06:47 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-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"
@@ -15,7 +15,7 @@
 *
 */
 
-#include <registryinfo.rh>
+#include <ecom/registryinfo.rh>
 
 // Declares info for two implementations
 RESOURCE REGISTRY_INFO theInfo
--- a/atext/server/group/atextcommonbase.mmp	Wed Jul 21 15:42:05 2010 +0300
+++ b/atext/server/group/atextcommonbase.mmp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-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"
@@ -34,12 +34,6 @@
 // Default system include paths for OS extension layer modules.
 OS_LAYER_SYSTEMINCLUDE
 
-// Note:
-// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones.
-// If there is a S60 header in the subdirectory then that should be
-// added into the include statements (like #include <phonebook/header.h>)
-//SYSTEMINCLUDE           /epoc32/include/ecom
-
 LIBRARY                 ecom.lib
 LIBRARY                 euser.lib
 
--- a/atext/server/group/atextpluginbase.mmp	Wed Jul 21 15:42:05 2010 +0300
+++ b/atext/server/group/atextpluginbase.mmp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-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"
@@ -34,12 +34,6 @@
 // Default system include paths for OS extension layer modules.
 OS_LAYER_SYSTEMINCLUDE
 
-// Note:
-// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones.
-// If there is a S60 header in the subdirectory then that should be
-// added into the include statements (like #include <phonebook/header.h>)
-//SYSTEMINCLUDE           /epoc32/include/ecom
-
 LIBRARY                 ecom.lib
 LIBRARY                 euser.lib
 
--- a/atext/server/group/extsrv.mmp	Wed Jul 21 15:42:05 2010 +0300
+++ b/atext/server/group/extsrv.mmp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-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"
@@ -62,12 +62,6 @@
 // Default system include paths for OS extension layer modules.
 OS_LAYER_SYSTEMINCLUDE
 
-// Note:
-// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones.
-// If there is a S60 header in the subdirectory then that should be
-// added into the include statements (like #include <phonebook/header.h>)
-//SYSTEMINCLUDE           /epoc32/include/ecom
-
 LIBRARY                 atextpluginbase.lib
 LIBRARY			        ecom.lib
 LIBRARY			        euser.lib
--- a/atext/server/group/extsrvcommon.mmp	Wed Jul 21 15:42:05 2010 +0300
+++ b/atext/server/group/extsrvcommon.mmp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-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"
@@ -36,12 +36,6 @@
 // Default system include paths for OS extension layer modules.
 OS_LAYER_SYSTEMINCLUDE
 
-// Note:
-// The only other SYSTEMINCLUDE should you shall add are Symbian specific ones.
-// If there is a S60 header in the subdirectory then that should be
-// added into the include statements (like #include <phonebook/header.h>)
-//SYSTEMINCLUDE           /epoc32/include/ecom
-
 LIBRARY                 atextcommonbase.lib
 LIBRARY			        ecom.lib
 LIBRARY			        euser.lib
--- a/bluetooth/btexample/example/btproperties/BTProperties.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btexample/example/btproperties/BTProperties.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -200,7 +200,7 @@
 	{
 	Start();
 	
-	TBuf16<KHCILocalDeviceNameMaxLength> val;
+	TBuf16<KMaxBluetoothNameLen> val;
 	iProperty.Get(val);
 
 	iTest.Printf(_L("%S = %S\n"), &iString, &val);
--- a/bluetooth/btextnotifiers/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btextnotifiers/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -15,9 +15,9 @@
 
 
 PRJ_EXPORTS
-inc/BTExtNotifiers.h		SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(btextnotifiers.h)
-inc/BTExtNotifiersPartner.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(btextnotifierspartner.h)
-inc/BTExtNotifiersConsts.h	SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(btextnotifiersconsts.h)
+inc/BTExtNotifiers.h		OS_LAYER_PUBLIC_EXPORT_PATH(btextnotifiers.h)
+inc/BTExtNotifiersPartner.h	OS_LAYER_PLATFORM_EXPORT_PATH(btextnotifierspartner.h)
+inc/BTExtNotifiersConsts.h	OS_LAYER_PUBLIC_EXPORT_PATH(btextnotifiersconsts.h)
 
 PRJ_MMPFILES
 src/BTExtNotifiers.mmp
--- a/bluetooth/btextnotifiers/inc/BTExtNotifiers.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btextnotifiers/inc/BTExtNotifiers.h	Thu Sep 23 17:06:47 2010 +0300
@@ -128,8 +128,8 @@
 	IMPORT_C TBool UplinkAccessAllowed() const;
 	IMPORT_C TBool IsValid() const;
 	
-	// Non-exported constructor.  Allows creation of default NULL instance
-	TPanConnection();
+	// Allows creation of default NULL instance
+	IMPORT_C TPanConnection();
 	
 private:
 	TBTDevAddr iRemoteDeviceAddress;
--- a/bluetooth/btlogger/btsnoophcilogger/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btlogger/btsnoophcilogger/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -16,7 +16,7 @@
 #include "../test/headercheck/group/bld.inf"
 
 PRJ_EXPORTS
-../public/hciframelogger.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hciframelogger.h)
+../public/hciframelogger.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hciframelogger.h)
 btsnoophcilogger.iby			/epoc32/rom/include/btsnoophcilogger.iby
 
 PRJ_MMPFILES
--- a/bluetooth/btlogger/generic/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btlogger/generic/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -20,9 +20,9 @@
 #include "../test/headercheck/group/bld.inf"
 
 PRJ_EXPORTS
-../public/logger.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/logger.h)
-../public/components.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/logger/components.h)
-btlogger.mmh				SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/btlogger.mmh)
+../public/logger.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/logger.h)
+../public/components.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/logger/components.h)
+btlogger.mmh				OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/btlogger.mmh)
 
 btlogger.iby        /epoc32/rom/include/btlogger.iby
 
--- a/bluetooth/btsdp/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btsdp/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -14,7 +14,7 @@
 // Bld.inf file for bluetooth service discovery protocol
 
 PRJ_EXPORTS
-inc/btsdp.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(btsdp.h)
+inc/btsdp.h OS_LAYER_PUBLIC_EXPORT_PATH(btsdp.h)
 
 PRJ_MMPFILES
 database/sdpdatabase.mmp
--- a/bluetooth/btsdp/server/protocol/listener.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btsdp/server/protocol/listener.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -466,6 +466,10 @@
 	addr.SetSecurity(sdpSecurity);
 
 	User::LeaveIfError(iListener.Bind(addr));
+	TPckgBuf<TBool> noSecurityRequired;
+	noSecurityRequired() = ETrue;
+
+	User::LeaveIfError(iListener.SetOpt(KBTSetNoSecurityRequired, KSolBtSAPBase, noSecurityRequired));
 	User::LeaveIfError(iListener.Listen(iQueSize));
 	}
 
--- a/bluetooth/btstack/HCIShared/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/HCIShared/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -14,7 +14,7 @@
 //
 
 PRJ_EXPORTS
-../interface/hcishared.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcishared.h)
+../interface/hcishared.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcishared.h)
 
 PRJ_MMPFILES
 hcishared.mmp
--- a/bluetooth/btstack/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-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"
@@ -29,23 +29,21 @@
 common/bt_v2.mmp
 
 PRJ_EXPORTS
-linkmgr/interface/LinkMuxNotifier.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/linkmuxnotifier.h)
-linkmgr/interface/PhysicalLinksState.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/physicallinksstate.h)
-linkmgr/interface/HardResetInitiator.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hardresetinitiator.h)
-eirman/interface/eirmanshared.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/eirmanshared.h)
-secman/public/pairingservershared.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/pairingservershared.h)
+linkmgr/interface/LinkMuxNotifier.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/linkmuxnotifier.h)
+linkmgr/interface/PhysicalLinksState.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/physicallinksstate.h)
+linkmgr/interface/HardResetInitiator.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hardresetinitiator.h)
 
+eirman/interface/eirmanshared.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/eirmanshared.h)
+
+secman/public/pairingservershared.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/pairingservershared.h)
+
+l2cap/l2capdebuginfo.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/l2capdebuginfo.h)
 
 
 // Stack configuration file
-
-bluetooth_stack.ini /epoc32/data/z/private/101f7989/bluetooth/bluetooth_stack.ini
-bluetooth_stack.ini /epoc32/release/winscw/udeb/z/private/101f7989/bluetooth/bluetooth_stack.ini
-bluetooth_stack.ini /epoc32/release/winscw/urel/z/private/101f7989/bluetooth/bluetooth_stack.ini
-
-PRJ_EXPORTS
-l2cap/l2capdebuginfo.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/l2capdebuginfo.h)
+bluetooth_stack.ini z:/private/101f7989/bluetooth/bluetooth_stack.ini
 
 
 
 
+
--- a/bluetooth/btstack/bluetooth_stack.ini	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/bluetooth_stack.ini	Thu Sep 23 17:06:47 2010 +0300
@@ -19,6 +19,4 @@
 [CoreHci]
 EcomUid= 0x102736DE
 
-[lowpowermodeconfiguration]
-overridelpmtimeout_microseconds= 0
 
--- a/bluetooth/btstack/common/bt.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/common/bt.h	Thu Sep 23 17:06:47 2010 +0300
@@ -44,7 +44,6 @@
 	EPreauthoriseDevice, // used for multiple SAPs operating in one usecase (eg AVRCP and GAVDP);
 	ESubscribePhysicalLink,
 	EUnsubscribePhysicalLink,
-	EOverrideLPMWithTimeout,
 	EOverrideLPM,
 	EUndoOverrideLPM,
 	ETryToAndThenPreventHostEncryptionKeyRefresh,
--- a/bluetooth/btstack/common/bt_v2.mmp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/common/bt_v2.mmp	Thu Sep 23 17:06:47 2010 +0300
@@ -78,6 +78,8 @@
 SOURCE hcifacade_events.cpp
 SOURCE physicallinks.cpp
 SOURCE PhysicalLinkHelper.cpp
+SOURCE roleswitchhelper.cpp
+SOURCE encryptionkeyrefreshhelper.cpp
 SOURCE basebandsap.cpp
 SOURCE physicallinksmanager.cpp
 SOURCE physicallinkmetrics.cpp
--- a/bluetooth/btstack/common/btsap.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/common/btsap.cpp	Thu Sep 23 17:06: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"
@@ -27,7 +27,7 @@
 const char* const KBT_SAP_NAME_DIAG = __PLATSEC_DIAGNOSTIC_STRING("Bluetooth SAP");
 
 CBluetoothSAP::CBluetoothSAP(CBTSecMan& aSecMan, CBTCodServiceMan& aCodMan)
-: iSecMan(aSecMan), iCodMan(aCodMan)
+: iSecMan(aSecMan), iCodMan(aCodMan), iNoSecurityRequired(EFalse)
 	{
 	}
 
@@ -166,6 +166,7 @@
 						aSAPWithSecuritySettings.Override(RemoteAddress()),
 						RemoteAddress(),
 						aSecurityModeFourOutgoing ? EGeneralBondingSecurityMode4Outgoing : EGeneralBonding, // We are doing general bonding
+						aSAPWithSecuritySettings.iNoSecurityRequired,
 						const_cast<MAccessRequestResponseHandler&>(handler)));
 
 	if (err != KErrNone)
@@ -273,7 +274,21 @@
 				rerr = SetCodServiceBits(newServiceBits);	// The service bits are saved and then registered when SAP becomes live
 				}
 				break;	
-
+			case KBTSetNoSecurityRequired:
+				{
+				__ASSERT_DEBUG(iSecurityChecker, User::Panic(KSECURITY_PANIC, EBTPanicNullSecurityChecker));
+				rerr = iSecurityChecker->CheckPolicy(KSDP_SID_PROT_SERV, KBT_SAP_NAME_DIAG);
+				if (rerr == KErrNone)
+					{
+					iNoSecurityRequired = *reinterpret_cast<const TBool*>(aOption.Ptr());
+					}
+				}
+				break;
+			case KBTSecurityDeviceOverride:
+				{
+				rerr = SetDeviceOverride(aOption); 
+				}
+				break;
 			default:
 				// Unhandled SetOpt name
 				rerr = KErrNotSupported;
--- a/bluetooth/btstack/inc/BtSap.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/inc/BtSap.h	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -89,6 +89,7 @@
 	CBTCodServiceMan&	iCodMan;
 
 	CAsyncCallBack*		iAccessDeniedCallBack;
+	TBool iNoSecurityRequired;
 	};
 
 
--- a/bluetooth/btstack/l2cap/l2capSAPSignalHandler.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/l2cap/l2capSAPSignalHandler.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -813,8 +813,9 @@
 	{
 	LOG_FUNC
 	// The SAP is about to be detached from this signal handler.
-	// Ensure no park overrides are active.
+	// Ensure no overrides are active.
 	UndoOverrideParkMode();
+	UndoOverrideLPM();
 	
 	// Check if this SH has any unsent commands
 	// outstanding.
@@ -916,15 +917,26 @@
 		iSAP->Protocol().ControlPlane().ModifyPhysicalLink(EUndoOverridePark, iSAP->RemoteDev());
 		}
 	}
-	
-void CL2CapSAPSignalHandler::OverrideLPMWithTimeout()
+
+void CL2CapSAPSignalHandler::OverrideLPM()
 	{
 	LOG_FUNC
 	// Temporarily override all low power modes.  A reference to the SAP is required
 	// to get the remote device address.
 	if(iSAP)
 		{
-		iSAP->Protocol().ControlPlane().ModifyPhysicalLink(EOverrideLPMWithTimeout, iSAP->RemoteDev());
+		iSAP->Protocol().ControlPlane().ModifyPhysicalLink(EOverrideLPM, iSAP->RemoteDev());
 		}
 	}
-	
+
+void CL2CapSAPSignalHandler::UndoOverrideLPM()
+	{
+	LOG_FUNC
+	// Remove the temporary override of all low power modes.  A reference to the SAP is 
+	// required to get the remote device address.
+	if(iSAP)
+		{
+		iSAP->Protocol().ControlPlane().ModifyPhysicalLink(EUndoOverrideLPM, iSAP->RemoteDev());
+		}
+	}
+
--- a/bluetooth/btstack/l2cap/l2capSAPSignalHandler.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/l2cap/l2capSAPSignalHandler.h	Thu Sep 23 17:06:47 2010 +0300
@@ -141,7 +141,8 @@
 
 	void OverrideParkMode();
 	void UndoOverrideParkMode();
-	void OverrideLPMWithTimeout();
+	void OverrideLPM();
+	void UndoOverrideLPM();
 
 	inline TInt SignalHandlerErrorCode() const;
 	inline MSocketNotify::TOperationBitmasks SignalHandlerErrorAction() const;
--- a/bluetooth/btstack/l2cap/l2capSigStates.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/l2cap/l2capSigStates.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -286,6 +286,8 @@
 	{
 	LOG_FUNC
 	// The SAP has requested a channel be opened.
+	// Override all LPMs to try and avoid signalling timeouts
+	aSignalHandler.OverrideLPM();
 
 	TInt err = aSignalHandler.ChannelConfig().UpdateLocalConfigWithEntityCapabilities();
 	if (err == KErrNone)
@@ -298,9 +300,6 @@
 			// Update local Port.
 			aSignalHandler.SetLocalPort(port);
 	
-			// Override park to allow the connection to be made.
-			aSignalHandler.OverrideParkMode();
-	
 			// Active connection.  Send a Connect Request command.
 			err = aSignalHandler.ConstructConnectionRequest();
 			if(err == KErrNone)
@@ -330,10 +329,8 @@
 		// Update local Port.
 		aSignalHandler.SetLocalPort(port);
 
-		// Override park to allow the connection to be made.
-		aSignalHandler.OverrideParkMode();
-		// Override all LPMs (if timeout not set to zero)
-		aSignalHandler.OverrideLPMWithTimeout();
+		// Override all LPMs to try and avoid signalling timeouts
+		aSignalHandler.OverrideLPM();
 
 		// Send a response with a 'pending' result and start security procedure.
 		err = aSignalHandler.ConstructConnectionResponse(aSignalHandler.GetOutstandingRequestID(),
@@ -384,10 +381,16 @@
 
 	aSignalHandler.iOpenChannelRequestAwaitingPeerEntityConfig = EFalse;
 
-	// If Park mode has been overridden during either channel establishment or
-	// channel disconnect, remove the override.
-	// NB It is safe to call this method multiple times.
+	// Depending where we came from we may have applied either a
+	// park override or an all LPM override.  We remove both these
+	// overrides because it's safe to remove an override that 
+	// hasn't been applied.
+	// Note that although park is one of the LPMs the different
+	// levels of override are managed separately, so an
+	// UndoOverrideLPM does not remove an explicit park only 
+	// override.
 	aSignalHandler.UndoOverrideParkMode();
+	aSignalHandler.UndoOverrideLPM();
 
 	// If the signal handler has left the closed state, it will have been added
 	// to the SH list in the Muxer.  Now that the closed state is being
@@ -898,6 +901,9 @@
 void TL2CAPSigStateWaitConfig::Enter(CL2CapSAPSignalHandler& aSignalHandler) const
 	{
 	LOG_FUNC
+	// Cancel the Config timer if it's running
+	aSignalHandler.CancelTimer();
+	
 	// First start the ConfigReq sending delay timer (see DelayConfigRequest() for why).
 	// It's short lived, we'll start the proper L2CAP config timer when it expires.
 	aSignalHandler.StartConfigRequestDelayTimer();
@@ -1088,8 +1094,16 @@
 		}
 	else
 		{
-		// Remove and park override.
+		// Depending where we came from we may have applied either a
+		// park override or an all LPM override.  We remove both these
+		// overrides because it's safe to remove an override that 
+		// hasn't been applied.
+		// Note that although park is one of the LPMs the different
+		// levels of override are managed separately, so an
+		// UndoOverrideLPM does not remove an explicit park only 
+		// override.
 		aSignalHandler.UndoOverrideParkMode();
+		aSignalHandler.UndoOverrideLPM();
 
 		// Cancel the configuration timer.
 		aSignalHandler.CancelTimer();
@@ -1146,7 +1160,23 @@
 void TL2CAPSigStateWaitDisconnect::DisconnectResponse(CL2CapSAPSignalHandler& aSignalHandler) const
 	{
 	LOG_FUNC
-	aSignalHandler.DrainPendingCommands();
+	// We've got a disconnect response, we're done.  Any remaing stuff on the queue
+	// is redundant, so ditch it and close synchronously.
+	aSignalHandler.FlushAllQueues();
+	
+	// If an error condition has been recorded forward the error 
+	// to the SAP.
+	if(aSignalHandler.SignalHandlerErrorCode() != KErrNone)
+		{
+		Error(aSignalHandler, aSignalHandler.SignalHandlerErrorCode(), aSignalHandler.SignalHandlerErrorAction());
+		}
+	else
+		{
+		// This will delete the signal handler if the SAP has detached.
+		aSignalHandler.SetState(iFactory.GetState(CL2CAPSignalStateFactory::EClosed));
+		aSignalHandler.SignalHandlerDisconnectedCanClose();
+		}
+
 	}
 
 // "Artificial" state events
@@ -1170,7 +1200,9 @@
 void TL2CAPSigStateWaitDisconnect::Enter(CL2CapSAPSignalHandler& aSignalHandler) const
 	{
 	LOG_FUNC
-	// Override park to allow the disconnect to continue.
+	// Only override park for disconnect.  We need to be able
+	// to send the signalling, but we don't care if it takes
+	// ages.  No point starting a sniff bun-fight.
 	aSignalHandler.OverrideParkMode();
 
 	// Cancel the configuration timer.
--- a/bluetooth/btstack/l2cap/l2sapstates.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/l2cap/l2sapstates.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -1423,6 +1423,13 @@
 	// Consume the event.
 	}
 	
+void TL2CAPSAPStateError::SignalHandlerError(CL2CAPConnectionSAP& /*aSAP*/, TInt /*aErrorCode*/, MSocketNotify::TOperationBitmasks /*aErrorAction*/) const
+    {
+    LOG_FUNC
+    // Already in the error state so no need to transition.
+    // Consume the event.
+    }   
+
 // State Transition Actions.
 void TL2CAPSAPStateError::Enter(CL2CAPConnectionSAP& aSAP) const
 	{
--- a/bluetooth/btstack/l2cap/l2sapstates.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/l2cap/l2sapstates.h	Thu Sep 23 17:06:47 2010 +0300
@@ -412,6 +412,7 @@
 
 	// Events called from the SAP Signal Handler.
 	void ChannelClosed(CL2CAPConnectionSAP& aSAP) const;
+	void SignalHandlerError(CL2CAPConnectionSAP& /*aSAP*/, TInt /*aErrorCode*/, MSocketNotify::TOperationBitmasks /*aErrorAction*/) const;
 
 	// State Transition Actions.
 	void Enter(CL2CAPConnectionSAP& aSAP) const;	
--- a/bluetooth/btstack/linkmgr/MBtHostControllerEventInternalNotifier.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/MBtHostControllerEventInternalNotifier.h	Thu Sep 23 17:06:47 2010 +0300
@@ -67,6 +67,8 @@
 	virtual void RemoteName(THCIErrorCode /*aErr*/, const TBTDevAddr& /*aAddr*/, const TBTDeviceName8& /*aName*/) {};
 
 	virtual void SimplePairingComplete(const TBTDevAddr& /*aBDAddr*/, THCIErrorCode /*aErr*/) {};
+	
+	virtual void EncryptionKeyRefreshComplete(THCIErrorCode /*aErr*/, THCIConnHandle /*aConnH*/) {};
 	};
 
 #endif //_MBTHOSTCONTROLEREVENTINTERNALNOTIFIER_H_
--- a/bluetooth/btstack/linkmgr/PhysicalLinkHelper.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/PhysicalLinkHelper.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -22,60 +22,37 @@
 #include "ProxySAP.h"
 #include "linkmgr.h"
 
+
 #ifdef __FLOG_ACTIVE
 _LIT8(KLogComponent, LOG_COMPONENT_LINKMGR);
 #endif
 
-CRoleSwitcher::CRoleSwitcher(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink, TBTBasebandRole aRole)
-	: CTimer(CActive::EPriorityStandard)
-	, iLinkMgr(aLinkMgr)
+CPhysicalLinkHelper::CPhysicalLinkHelper(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink)
+	: iLinkMgr(aLinkMgr)
 	, iLink(aLink)
-	, iRole(aRole)
-	, iIsEncryptionDisabledForRoleSwitch(EFalse)
 	{
 	LOG_FUNC
-	iState = &iLinkMgr.RoleSwitcherStateFactory().GetState(CRoleSwitcherStateFactory::EIdle);
-	}
-
-CRoleSwitcher* CRoleSwitcher::NewL(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink, TBTBasebandRole aRole)
-	{
-	LOG_STATIC_FUNC
-	CRoleSwitcher* self = new(ELeave) CRoleSwitcher(aLinkMgr, aLink, aRole);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
 	}
 	
-void CRoleSwitcher::ConstructL()
+void CPhysicalLinkHelper::BaseConstructL()
 	{
 	LOG_FUNC
 	
 	// create Proxy telling it the possible PHY
 	iBTProxySAP = CBTProxySAP::NewL(iLinkMgr, &iLink);
 	iBTProxySAP->SetNotify(this);
-		
-	TCallBack cb(EventReceivedCallBack, this);
-	iEventReceivedCallBack = new (ELeave)CAsyncCallBack(cb, EActiveHighPriority);
-
-	CTimer::ConstructL();
-	CActiveScheduler::Add(this);
-
-	// add ourselves to the list in LinkMgr, LinkMgr will kick off the role change state machine 	
-	iLinkMgr.AddRoleSwitcher(*this);
-	iAddedToLinkMgr = ETrue;
+	
+	TCallBack ecb(EventReceivedCallBack, this);
+	iEventReceivedCallBack = new (ELeave)CAsyncCallBack(ecb, EActiveHighPriority);
 	}
 	
-CRoleSwitcher::~CRoleSwitcher()
+CPhysicalLinkHelper::~CPhysicalLinkHelper()
 	{
 	LOG_FUNC
-	if (iAddedToLinkMgr)
-		{
-		iLinkMgr.RemoveRoleSwitcher(*this);
-		}
-		
-	Cancel(); // watchdog timer
+	
+	RemoveTimer();
 	delete iBTProxySAP;
+	
 	if (iEventReceivedCallBack)
 		{
 		iEventReceivedCallBack->Cancel();
@@ -83,158 +60,14 @@
 		}
 	}
 
-void CRoleSwitcher::DisableLPM()
+void CPhysicalLinkHelper::DisableLPM()
    	{
 	LOG_FUNC
 	TPckgBuf<TInt> optionBuf;	
    	iBTProxySAP->SAPSetOption(KSolBtLMProxy, EBBRequestPreventAllLowPowerModes, optionBuf);
    	}
 
-void CRoleSwitcher::EnableLPM()
-   	{
-	LOG_FUNC
-	TPckgBuf<TInt> optionBuf;	
-   	iBTProxySAP->SAPSetOption(KSolBtLMProxy, EBBRequestAllowAllLowPowerModes, optionBuf);
-   	}
-
-void CRoleSwitcher::DisableEncryption()
-  	{
-	LOG_FUNC
- 	// data traffic suspended
-	iLinkMgr.LinkManagerProtocol().ACLController().SetParked(iLink.Handle(), ETrue);
-   	TBTBasebandEvent event(ENotifyEncryptionChangeOff);
-   	iBTProxySAP->Ioctl(KSolBtLMProxy, KLMBasebandEventOneShotNotificationIoctl, &event);
-	iLinkMgr.Encrypt(EFalse, iLink);
-
-	// set flag here, it's too late when we receive the event as AccessReqester
-	// might receive the baseband notification earlier then the flag is set!	
-	iIsEncryptionDisabledForRoleSwitch = ETrue;
-  	}
-
-void CRoleSwitcher::EnableEncryption()
-  	{
-	LOG_FUNC  	
-   	TBTBasebandEvent event(ENotifyEncryptionChangeOn);
-   	iBTProxySAP->Ioctl(KSolBtLMProxy, KLMBasebandEventOneShotNotificationIoctl, &event);
-	iLinkMgr.Encrypt(ETrue, iLink);	
-	// data traffic is enabled in IoctlComplete
-  	}
-   	
-void CRoleSwitcher::ChangeRole()
-	{
-	LOG_FUNC
-   	TBTBasebandEvent event(ENotifyAnyRole);
-   	iBTProxySAP->Ioctl(KSolBtLMProxy, KLMBasebandEventOneShotNotificationIoctl, &event);
-	iLinkMgr.ChangeRole(iRole, iLink);
-	}
-
-void CRoleSwitcher::CancelIoctl()
-	{
-	LOG_FUNC
-	iBTProxySAP->CancelIoctl(KSolBtLMProxy, KLMBasebandEventOneShotNotificationIoctl);
-	}
-	
-// Timer
-void CRoleSwitcher::RunL()
-	{
-	LOG_FUNC
-	iState->TimerExpired(*this);
-	}
-	
-TInt CRoleSwitcher::RunError(TInt aError)
-	{
-	LOG_FUNC
-	iState->Error(*this, aError);
-	return KErrNone;
-	}
-   	   	
-// From MSocketNotify
-void CRoleSwitcher::NewData(TUint /*aCount*/)
-	{
-	LOG_FUNC
-	
-	}
-	
-void CRoleSwitcher::CanSend()
-	{
-	LOG_FUNC
-	
-	}
-	
-void CRoleSwitcher::ConnectComplete()
-	{
-	LOG_FUNC
-	
-	}
-	
-void CRoleSwitcher::ConnectComplete(const TDesC8& /*aConnectData*/)
-	{
-	LOG_FUNC
-	
-	}
-	
-void CRoleSwitcher::ConnectComplete(CServProviderBase& /*aSSP*/)
-	{
-	LOG_FUNC
-	
-	}
-	
-void CRoleSwitcher::ConnectComplete(CServProviderBase& /*aSSP*/,const TDesC8& /*aConnectData*/)
-	{
-	LOG_FUNC
-	
-	}
-	
-void CRoleSwitcher::CanClose(TDelete /*aDelete*/)
-	{
-	LOG_FUNC
-	
-	}
-
-void CRoleSwitcher::CanClose(const TDesC8& /*aDisconnectData*/,TDelete /*aDelete*/)
-	{
-	LOG_FUNC
-	
-	}
-	
-void CRoleSwitcher::Error(TInt /*aError*/,TUint /*aOperationMask*/)
-	{
-	LOG_FUNC
-	
-	}
-	
-void CRoleSwitcher::Disconnect(void)
-	{
-	LOG_FUNC
-	iState->Error(*this, KErrDisconnected);
-	}
-
-void CRoleSwitcher::Disconnect(TDesC8& /*aDisconnectData*/)
-	{
-	LOG_FUNC
-	iState->Error(*this, KErrDisconnected);
-	}
-
-void CRoleSwitcher::Start()
-	{
-	LOG_FUNC
-	iState->Start(*this);
-	}
-
-void CRoleSwitcher::Finish()
-	{
-	LOG_FUNC
-	// async call to delete this class
-	iLink.AsyncDeleteRoleSwitcher();
-	}
-		
-void CRoleSwitcher::SaveEncryption()
-	{
-	LOG_FUNC
-	iIsEncrypted = iLink.Encrypted();
-	}
-	
-TBool CRoleSwitcher::IsEPRSupported() const
+TBool CPhysicalLinkHelper::IsEPRSupported() const
 	{
 	LOG_FUNC
 	// For Lisbon (Bluetooth 2.1), if EPR is supported both locally and remotely,
@@ -243,418 +76,144 @@
 	return iLink.IsEncryptionPauseResumeSupported();
 	}
 
-void CRoleSwitcher::LogRoleSwitchSuccessful() const
+void CPhysicalLinkHelper::NotifyBasebandEvent(TNotifyEvent aEvent)
+	{
+	LOG_FUNC
+	TBTBasebandEvent event(aEvent.NotifyEvent());
+	iBTProxySAP->Ioctl(KSolBtLMProxy, KLMBasebandEventOneShotNotificationIoctl, &event);
+	}
+
+void CPhysicalLinkHelper::CancelNotify()
+	{
+	LOG_FUNC
+	iBTProxySAP->CancelIoctl(KSolBtLMProxy, KLMBasebandEventOneShotNotificationIoctl);
+	}
+	
+void CPhysicalLinkHelper::QueueTimer(TTimeIntervalMicroSeconds32 aTimerVal)
+	{
+	LOG_FUNC
+
+	TCallBack cb(TimerExpiredCallBack, this);
+	iTimerEntry.Set(cb);
+	BTSocketTimer::Queue(aTimerVal, iTimerEntry);
+	}
+
+
+void CPhysicalLinkHelper::RemoveTimer()
+	{
+	LOG_FUNC
+
+	BTSocketTimer::Remove(iTimerEntry);
+	}
+   	   	
+// From MSocketNotify
+void CPhysicalLinkHelper::NewData(TUint /*aCount*/)
+	{
+	LOG_FUNC
+	
+	}
+	
+void CPhysicalLinkHelper::CanSend()
+	{
+	LOG_FUNC
+	
+	}
+	
+void CPhysicalLinkHelper::ConnectComplete()
 	{
 	LOG_FUNC
-	TInt eventType;
-	eventType = (iRole == EMaster ? ENotifyMaster :ENotifySlave);
+	
+	}
+	
+void CPhysicalLinkHelper::ConnectComplete(const TDesC8& /*aConnectData*/)
+	{
+	LOG_FUNC
+	
+	}
+	
+void CPhysicalLinkHelper::ConnectComplete(CServProviderBase& /*aSSP*/)
+	{
+	LOG_FUNC
 	
-	if (iBasebandEvent.EventType()==eventType &&
-	    iBasebandEvent.ErrorCode()==KErrNone)
-		{
-		LOG(_L("CRoleSwitcher RoleSwitch OK"));	
-		}
-	else 
-		{
-		LOG(_L("CRoleSwitcher RoleSwitch failed"));
-		}
+	}
+	
+void CPhysicalLinkHelper::ConnectComplete(CServProviderBase& /*aSSP*/,const TDesC8& /*aConnectData*/)
+	{
+	LOG_FUNC
+	
+	}
+	
+void CPhysicalLinkHelper::CanClose(TDelete /*aDelete*/)
+	{
+	LOG_FUNC
+	
 	}
 
-void CRoleSwitcher::IoctlComplete(TDesC8 *aBuf)
+void CPhysicalLinkHelper::CanClose(const TDesC8& /*aDisconnectData*/,TDelete /*aDelete*/)
+	{
+	LOG_FUNC
+	
+	}
+	
+void CPhysicalLinkHelper::Error(TInt /*aError*/,TUint /*aOperationMask*/)
+	{
+	LOG_FUNC
+	
+	}
+	
+void CPhysicalLinkHelper::Disconnect(void)
+	{
+	LOG_FUNC
+	Error(KErrDisconnected);
+	}
+
+void CPhysicalLinkHelper::Disconnect(TDesC8& /*aDisconnectData*/)
+	{
+	LOG_FUNC
+	Error(KErrDisconnected);
+	}
+
+void CPhysicalLinkHelper::IoctlComplete(TDesC8 *aBuf)
 	{
 	LOG_FUNC
 	const TBTBasebandEventNotification* event = reinterpret_cast<const TBTBasebandEventNotification*>(aBuf->Ptr());
 	iBasebandEvent = *event;
 	iEventReceivedCallBack->CallBack();
 	}
-	
-/*static*/ TInt CRoleSwitcher::EventReceivedCallBack(TAny* aRoleSwitcher)
-	{
-	LOG_STATIC_FUNC
-	CRoleSwitcher* roleSwitcher = static_cast<CRoleSwitcher*>(aRoleSwitcher);
-	roleSwitcher->iState->EventReceived(*roleSwitcher);
-	return EFalse;
-	}
-		
 
-//----------------------------------------------------------------------------------
-// STATE FACTORY
-//----------------------------------------------------------------------------------
-
-CRoleSwitcherStateFactory* CRoleSwitcherStateFactory::NewL()
+/*static*/ TInt CPhysicalLinkHelper::EventReceivedCallBack(TAny* aThis)
 	{
 	LOG_STATIC_FUNC
-	CRoleSwitcherStateFactory* ret=new (ELeave) CRoleSwitcherStateFactory();
-	CleanupStack::PushL(ret);
-	ret->ConstructL();
-	CleanupStack::Pop(ret);
-	return ret;
-	}
-
-void CRoleSwitcherStateFactory::ConstructL()
-	{
-	LOG_FUNC	
-	iStates[EIdle]					=new (ELeave) TRSStateIdle(*this);
-	iStates[EDisablingLPM]			=new (ELeave) TRSStateDisablingLPM(*this);
-	iStates[EDisablingEncryption]	=new (ELeave) TRSStateDisablingEncryption(*this);
-	iStates[EChangingRole]			=new (ELeave) TRSStateChangingRole(*this);
-	iStates[EChangingRoleWithEPR]	=new (ELeave) TRSStateChangingRoleWithEPR(*this);
-	iStates[EEnablingEncryption]	=new (ELeave) TRSStateEnablingEncryption(*this);
-	}
-
-CRoleSwitcherStateFactory::CRoleSwitcherStateFactory()
-	{
-	LOG_FUNC
-	iStates.DeleteAll();
-	}
-
-TRoleSwitcherState& CRoleSwitcherStateFactory::GetState(CRoleSwitcherStateFactory::TRoleSwitcherStates aState)
-	{
-	LOG_FUNC
-	__ASSERT_DEBUG(iStates[aState],  Panic(ERoleSwitcherInvalidState));
-	return *iStates[aState];
-	}
-
-TInt CRoleSwitcherStateFactory::StateIndex(const TRoleSwitcherState* aState) const
-	{
-	LOG_FUNC
-	TInt state;
-	for (state = 0; state < ERoleSwitcherMaxState; state++)
-		{
-		if (iStates[state] == aState)
-			{
-			return state;
-			}
-		}
-	
-	return KUnknownState;
-	}
-
-
-//----------------------------------------------------------------------------------
-// STATES
-//----------------------------------------------------------------------------------
-
-TRoleSwitcherState::TRoleSwitcherState(CRoleSwitcherStateFactory& aFactory)
-: iFactory(aFactory)
-	{
-	LOG_FUNC
-	}
-
-void TRoleSwitcherState::PanicInState(TLinkPanic aPanic) const
-	{
-	LOG_FUNC
-	Panic(aPanic, iFactory.StateIndex(this));
-	}
-
-void TRoleSwitcherState::ChangeState(CRoleSwitcher& aContext, CRoleSwitcherStateFactory::TRoleSwitcherStates aState) const
-	{
-	LOG_FUNC
-	
-	aContext.iState->Exit(aContext);
-
-#ifdef __FLOG_ACTIVE
-	TRoleSwitcherState* state=&iFactory.GetState(aState);
-	LOG2(_L("RoleSwitcher: State %S -> %S"), &aContext.iState->iName, &state->iName);
-#endif //__FLOG_ACTIVE
-	aContext.iState=&iFactory.GetState(aState);
-
-	aContext.iState->Enter(aContext);
+	CPhysicalLinkHelper* helper = static_cast<CPhysicalLinkHelper*>(aThis);
+	helper->DoEventReceivedCallBack();
+	return EFalse;
 	}
 
-void TRoleSwitcherState::Enter(CRoleSwitcher& /*aContext*/) const
-	{
-	LOG_FUNC
-	// do nothing
-	}
-
-void TRoleSwitcherState::Exit(CRoleSwitcher& /*aContext*/) const
-	{
-	LOG_FUNC
-	// do nothing
-	}
-
-void TRoleSwitcherState::Start(CRoleSwitcher& /*aContext*/) const
-	{
-	LOG_FUNC
-	PanicInState(ERoleSwitcherStateMachineInvalidEvent);
-	}
-
-void TRoleSwitcherState::Error(CRoleSwitcher& aContext, TInt /*aErr*/) const
-	{
-	LOG_FUNC
-	aContext.CancelIoctl();
-	aContext.Cancel();
-	ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
-	}
-
-void TRoleSwitcherState::EventReceived(CRoleSwitcher& /*aContext*/) const
-	{
-	LOG_FUNC
-	// do nothing
-	}
-
-void TRoleSwitcherState::TimerExpired(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
-	}
-
-//----------------------------------------------------------------------------------
-
-TRSStateIdle::TRSStateIdle(CRoleSwitcherStateFactory& aFactory)
-: TRoleSwitcherState(aFactory)
-	{
-	LOG_FUNC
-	STATENAME("TRSStateIdle");
-	}
-
-void TRSStateIdle::Start(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	aContext.After(KTimeoutRoleSwitch);	// watchdog timer
-	ChangeState(aContext, CRoleSwitcherStateFactory::EDisablingLPM);
-	}	
-
-void TRSStateIdle::Enter(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	aContext.Finish();
-	}	
-
-//----------------------------------------------------------------------------------
-
-TRSStateDisablingLPM::TRSStateDisablingLPM(CRoleSwitcherStateFactory& aFactory)
-: TRoleSwitcherState(aFactory)
-	{
-	LOG_FUNC
-	STATENAME("TRSStateDisablingLPM");
-	}
-
-void TRSStateDisablingLPM::Enter(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	// DisableLPM even if link is active to prevent possible LPM requests during encryption disabling
-
-	if (aContext.iLink.LinkMode() == EActiveMode)
-		{
-		aContext.DisableLPM();
-		if (aContext.IsEPRSupported())
-			{
-			ChangeState(aContext, CRoleSwitcherStateFactory::EChangingRoleWithEPR);
-			}
-		else
-			{
-			ChangeState(aContext, CRoleSwitcherStateFactory::EDisablingEncryption);
-			}
-		// don't wait for notification
-		}
-	else
-		{
-		TBTBasebandEvent event(ENotifyActiveMode);
-		aContext.iBTProxySAP->Ioctl(KSolBtLMProxy, KLMBasebandEventOneShotNotificationIoctl, &event);
-		aContext.DisableLPM();
-		}
-	}
-
-void TRSStateDisablingLPM::EventReceived(CRoleSwitcher& aContext) const
+void CPhysicalLinkHelper::DoEventReceivedCallBack()
 	{
 	LOG_FUNC
-	if (aContext.iBasebandEvent.EventType()==ENotifyActiveMode &&
-		aContext.iBasebandEvent.ErrorCode()==KErrNone)
-		{
-		if (aContext.IsEPRSupported())
-			{
-			ChangeState(aContext, CRoleSwitcherStateFactory::EChangingRoleWithEPR);
-			}
-		else
-			{
-			ChangeState(aContext, CRoleSwitcherStateFactory::EDisablingEncryption);
-			}
-		}
-	else 
-		{
-		LOG(_L("CRoleSwitcher RoleSwitch failed in DisableLPM"));
-		// we can quit SM, don't need to rewind
-		ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
-		}
-	}
-
-//----------------------------------------------------------------------------------
-TRSStateDisablingEncryption::TRSStateDisablingEncryption(CRoleSwitcherStateFactory& aFactory)
-: TRoleSwitcherState(aFactory)
-	{
-	LOG_FUNC
-	STATENAME("TRSStateDisablingEncryption");
-	}
-
-void TRSStateDisablingEncryption::Enter(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	aContext.SaveEncryption();
-	if (aContext.iIsEncrypted)
-		{
-		aContext.DisableEncryption();
-		}
-	else
-		{
-		ChangeState(aContext, CRoleSwitcherStateFactory::EChangingRole);
-		}
-	}
-
-void TRSStateDisablingEncryption::EventReceived(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	if (aContext.iBasebandEvent.EventType()==ENotifyEncryptionChangeOff &&
-	    aContext.iBasebandEvent.ErrorCode()==KErrNone)
-		{
-		ChangeState(aContext, CRoleSwitcherStateFactory::EChangingRole);
-		}
-	else 
-		{
-		LOG(_L("CRoleSwitcher RoleSwitch failed in DisableEncryption"));
-		// before quiting SM , try to enable LPM
-		aContext.EnableLPM();
-		ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
-		}
-	}
-
-void TRSStateDisablingEncryption::TimerExpired(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	aContext.CancelIoctl();
-	ChangeState(aContext, CRoleSwitcherStateFactory::EEnablingEncryption);
-	}
-
-//----------------------------------------------------------------------------------
-TRSStateChangingRole::TRSStateChangingRole(CRoleSwitcherStateFactory& aFactory)
-: TRoleSwitcherState(aFactory)
-	{
-	LOG_FUNC
-	STATENAME("TRSStateChangingRole");
-	}
-
-void TRSStateChangingRole::Enter(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	aContext.ChangeRole();
-	}
-
-void TRSStateChangingRole::EventReceived(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	aContext.Cancel();	// cancel watchdog timer
-
-	FTRACE(aContext.LogRoleSwitchSuccessful());
-	
-
-	ChangeState(aContext, CRoleSwitcherStateFactory::EEnablingEncryption);
-	}
-
-void TRSStateChangingRole::TimerExpired(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	aContext.CancelIoctl();
-	ChangeState(aContext, CRoleSwitcherStateFactory::EEnablingEncryption);
+	EventReceived(iBasebandEvent);
 	}
 
-//----------------------------------------------------------------------------------
-TRSStateChangingRoleWithEPR::TRSStateChangingRoleWithEPR(CRoleSwitcherStateFactory& aFactory)
-: TRoleSwitcherState(aFactory)
+/*static*/ TInt CPhysicalLinkHelper::TimerExpiredCallBack(TAny* aThis)
 	{
-	LOG_FUNC
-	STATENAME("TRSStateChangingRoleWithEPR");
-	}
-
-void TRSStateChangingRoleWithEPR::Enter(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	aContext.ChangeRole();
+	LOG_STATIC_FUNC
+	CPhysicalLinkHelper* helper = static_cast<CPhysicalLinkHelper*>(aThis);
+	helper->DoTimerExpiredCallBack();
+	return EFalse;
 	}
 
-void TRSStateChangingRoleWithEPR::EventReceived(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	aContext.Cancel();	// cancel watchdog timer
-
-	FTRACE(aContext.LogRoleSwitchSuccessful());
-		
-	ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
-	}
-
-void TRSStateChangingRoleWithEPR::TimerExpired(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	aContext.CancelIoctl();
-	ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
-	}
-
-//----------------------------------------------------------------------------------
-TRSStateEnablingEncryption::TRSStateEnablingEncryption(CRoleSwitcherStateFactory& aFactory)
-: TRoleSwitcherState(aFactory)
-	{
-	LOG_FUNC
-	STATENAME("TRSStateEnablingEncryption");
-	}
-
-void TRSStateEnablingEncryption::Enter(CRoleSwitcher& aContext) const
+void CPhysicalLinkHelper::DoTimerExpiredCallBack()
 	{
 	LOG_FUNC
-	if (aContext.iIsEncrypted)
-		{
-		aContext.After(KTimeoutOneCommand);
-		aContext.EnableEncryption();
-		}
-	else
-		{
-		aContext.EnableLPM();
-		ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
-		}
-	}
-	
-void TRSStateEnablingEncryption::Exit(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	if (aContext.iIsEncrypted)
-		{
-		// enable data traffic
-		aContext.iLinkMgr.LinkManagerProtocol().ACLController().SetParked(aContext.iLink.Handle(), EFalse);
-		}
+	TimerExpired();
 	}
 
-void TRSStateEnablingEncryption::EventReceived(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	aContext.Cancel(); // watchdog timer
-	if (aContext.iBasebandEvent.EventType()==ENotifyEncryptionChangeOn &&
-		aContext.iBasebandEvent.ErrorCode()==KErrNone)
-		{
-		aContext.EnableLPM();		
-		ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
-		aContext.iIsEncryptionDisabledForRoleSwitch = EFalse;
-		}
-	else 
-		{
-		LOG(_L("CRoleSwitcher SetEncryption failed, disconnect link"));
-		if (aContext.iLink.Terminate(ERemoteUserEndedConnection) != KErrNone) 
-			{
-			LOG(_L("CRoleSwitcher OOM"));
-			}
-		ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
-		}
-	}
-
-void TRSStateEnablingEncryption::TimerExpired(CRoleSwitcher& aContext) const
-	{
-	LOG_FUNC
-	LOG(_L("CRoleSwitcher Timeout in EncryptionEnable, disconnect"));
-	aContext.CancelIoctl();			
-	if (aContext.iLink.Terminate(ERemoteUserEndedConnection) != KErrNone)
-			{
-			LOG(_L("CRoleSwitcher OOM"));
-			}
-	ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
-	}
+	
 
 
 
+
+
+
+
--- a/bluetooth/btstack/linkmgr/PhysicalLinkHelper.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/PhysicalLinkHelper.h	Thu Sep 23 17:06:47 2010 +0300
@@ -22,28 +22,25 @@
 #include "linkutil.h"
 #include <bluetooth/hci/hciutil.h> 
 
-// watchdog for first half of the SM including:
-// DisablingLPM, DisablingEncryption, RoleSwitch
-const TUint KTimeoutRoleSwitch =   3000000;  // 3 s; 
-
-// watchdog for EnablingEncryption
-const TUint KTimeoutOneCommand =   2000000;  // 2 s;
- 
-class TRoleSwitcherState;
-
-NONSHARABLE_CLASS(CRoleSwitcher) : public CTimer, public MSocketNotify
+// A struct to allow both single event and combination events to be passed for requesting
+// notification.  This effectively moves the cast to a TInt to below the API rather than
+// being required by the client.
+struct TNotifyEvent
 	{
-	friend class TRoleSwitcherState;
-	friend class TRSStateDisablingLPM;
-	friend class TRSStateDisablingEncryption;
-	friend class TRSStateChangingRole;
-	friend class TRSStateChangingRoleWithEPR;
-	friend class TRSStateEnablingEncryption;
+public:
+	TNotifyEvent(TBTPhysicalLinkStateNotifier aSingleEvent) : iEvent(aSingleEvent) {};
+	TNotifyEvent(TBTPhysicalLinkStateNotifierCombinations aComboEvent) : iEvent(aComboEvent) {};
 
-public:
+	TInt NotifyEvent() const {return iEvent;};
+private:
+	TInt iEvent;
+	};
 
-	static CRoleSwitcher* NewL(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink, TBTBasebandRole aRole);
-	~CRoleSwitcher();
+
+NONSHARABLE_CLASS(CPhysicalLinkHelper) : public CBase, public MSocketNotify
+	{
+public:
+	~CPhysicalLinkHelper();
 
 	// From MSocketNotify
 	void NewData(TUint aCount);
@@ -61,196 +58,50 @@
 	void NoBearer(const TDesC8& /*aConnectionInf*/) {};
 	void Bearer(const TDesC8& /*aConnectionInf*/) {};
 
-	void Start();
-	void Finish();
+	virtual void StartHelper() = 0;
+
 	inline const TBTDevAddr& BDAddr() const;
-	inline TBTBasebandRole RequestedRole() const;
-	inline TBool IsEncryptionDisabledForRoleSwitch() const;
-	TBool IsEPRSupported() const;
-	void LogRoleSwitchSuccessful() const;
-	TSglQueLink   iQLink;
 
-private:
-	CRoleSwitcher(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink, TBTBasebandRole aRole);
-	void ConstructL(); 
+protected:
+	CPhysicalLinkHelper(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink);
+	void BaseConstructL();
 
 	void DisableLPM();
-	void DisableEncryption();
-	void ChangeRole();
-	void EnableEncryption();
-	void EnableLPM();
-	void CancelIoctl();
 	
-	void SaveEncryption();
-	// CTimer
-	void RunL();
-	TInt RunError(TInt aError);
+	void QueueTimer(TTimeIntervalMicroSeconds32 aTimerVal);
+	void RemoveTimer();
+	void NotifyBasebandEvent(TNotifyEvent aEvent);
+	void CancelNotify();
 	
-	static TInt EventReceivedCallBack(TAny* aRoleSwitcher);
-	// Async Callback to notify baseband event received.
-	CAsyncCallBack*               iEventReceivedCallBack;
-	TBTBasebandEventNotification    iBasebandEvent;
-	TBool                      iIsEncrypted;
-	TBool                      iIsActive;  // LinkMode
-	TBool                     iAddedToLinkMgr;
-	CPhysicalLinksManager&          iLinkMgr;
-	CPhysicalLink&                iLink;
-	TBTBasebandRole               iRole;  // Requested role   
-	CBTProxySAP*                iBTProxySAP;   
-	TRoleSwitcherState*            iState;
-	TBool                     iIsEncryptionDisabledForRoleSwitch;             
-	};
-
-//--------------------------------------------------
-// STATE FACTORY
-//--------------------------------------------------
-
-/**
-   Factory for the RoleSwitcher states
-
-   The states are flyweight classes
-**/
-NONSHARABLE_CLASS(CRoleSwitcherStateFactory) : public CBase
-	{
-public:
-	static CRoleSwitcherStateFactory* NewL();
-
-	enum TRoleSwitcherStates
-		{
-		EIdle,
-		EDisablingLPM,
-		EDisablingEncryption,
-		EChangingRole,
-		EChangingRoleWithEPR,
-		EEnablingEncryption,
-	// *** keep next one last ***
-		ERoleSwitcherMaxState,
-		};
+	TBool IsEPRSupported() const;
 	
-	TRoleSwitcherState& GetState(TRoleSwitcherStates aState);
-	TInt StateIndex(const TRoleSwitcherState* aState) const;
+	virtual void TimerExpired() = 0;
+	virtual void HandleError(TInt aError) = 0;
+	virtual void EventReceived(TBTBasebandEventNotification& aEvent) = 0;
 	
 private:
-	CRoleSwitcherStateFactory();
-	void ConstructL();
-	TFixedArray<TRoleSwitcherState*, ERoleSwitcherMaxState> iStates;
+	static TInt EventReceivedCallBack(TAny* aThis);
+	void DoEventReceivedCallBack();
+	
+	static TInt TimerExpiredCallBack(TAny* aThis);
+	void DoTimerExpiredCallBack();
+	
+protected:
+	CPhysicalLinksManager&			iLinkMgr;
+	CPhysicalLink&					iLink;
+	
+private:
+	// Async Callback to notify baseband event received.
+	CAsyncCallBack*					iEventReceivedCallBack;
+	TBTBasebandEventNotification	iBasebandEvent;
+	CBTProxySAP*					iBTProxySAP;  
+	
+	TDeltaTimerEntry				iTimerEntry;
 	};
 
-
-
-//--------------------------------------------------
-// STATES, base 
-//--------------------------------------------------
-
-NONSHARABLE_CLASS(TRoleSwitcherState)
-	{
-public:
-	TRoleSwitcherState(CRoleSwitcherStateFactory& aFactory);
-	
-	virtual void Enter(CRoleSwitcher& aContext) const;
-	virtual void Exit(CRoleSwitcher& aContext) const;
-
-	virtual void Start(CRoleSwitcher& aContext) const;
-	virtual void EventReceived(CRoleSwitcher& aContext) const;
-	virtual void Error(CRoleSwitcher& aContext, TInt aErr) const;
-	virtual void TimerExpired(CRoleSwitcher& aContext) const;
-
-protected:
-	// Exits old state, sets the new state, and enters it.
-	void ChangeState(CRoleSwitcher& aContext, CRoleSwitcherStateFactory::TRoleSwitcherStates aState) const;
-	void PanicInState(TLinkPanic aPanic) const;
-	
-protected:
-	CRoleSwitcherStateFactory& iFactory;
-#ifdef __FLOG_ACTIVE
-	TBuf<48> iName;
-#endif
-	};
-
-
-//--------------------------------------------------
-// STATES 
-//--------------------------------------------------
-
-NONSHARABLE_CLASS(TRSStateIdle) : public TRoleSwitcherState
-	{
-public:
-	TRSStateIdle(CRoleSwitcherStateFactory& aFactory);
-
-	virtual void Enter(CRoleSwitcher& aContext) const;
-	virtual void Start(CRoleSwitcher& aContext) const;
-	};
-
-
-NONSHARABLE_CLASS(TRSStateDisablingLPM) : public TRoleSwitcherState
-	{
-public:
-	TRSStateDisablingLPM(CRoleSwitcherStateFactory& aFactory);
-
-	virtual void Enter(CRoleSwitcher& aContext) const;
-	virtual void EventReceived(CRoleSwitcher& aContext) const;
-	};
-
-NONSHARABLE_CLASS(TRSStateDisablingEncryption) : public TRoleSwitcherState
-	{
-public:
-	TRSStateDisablingEncryption(CRoleSwitcherStateFactory& aFactory);
-
-	virtual void Enter(CRoleSwitcher& aContext) const;
-	virtual void EventReceived(CRoleSwitcher& aContext) const;
-	virtual void TimerExpired(CRoleSwitcher& aContext) const;
-	};
-
-NONSHARABLE_CLASS(TRSStateChangingRole) : public TRoleSwitcherState
-	{
-public:
-	TRSStateChangingRole(CRoleSwitcherStateFactory& aFactory);
-
-	virtual void Enter(CRoleSwitcher& aContext) const;
-	virtual void EventReceived(CRoleSwitcher& aContext) const;
-	virtual void TimerExpired(CRoleSwitcher& aContext) const;
-	};
-
-NONSHARABLE_CLASS(TRSStateChangingRoleWithEPR) : public TRoleSwitcherState
-	{
-public:
-	TRSStateChangingRoleWithEPR(CRoleSwitcherStateFactory& aFactory);
-
-	virtual void Enter(CRoleSwitcher& aContext) const;
-	virtual void EventReceived(CRoleSwitcher& aContext) const;
-	virtual void TimerExpired(CRoleSwitcher& aContext) const;
-	};
-
-NONSHARABLE_CLASS(TRSStateEnablingEncryption) : public TRoleSwitcherState
-	{
-public:
-	TRSStateEnablingEncryption(CRoleSwitcherStateFactory& aFactory);
-
-	virtual void Enter(CRoleSwitcher& aContext) const;
-	virtual void Exit(CRoleSwitcher& aContext) const;   
-	virtual void EventReceived(CRoleSwitcher& aContext) const;
-	virtual void TimerExpired(CRoleSwitcher& aContext) const;
-	};
-
-#ifdef __FLOG_ACTIVE
-#define STATENAME(x)  iName=_L(x)
-#else
-#define STATENAME(x)
-#endif
-
-inline const TBTDevAddr& CRoleSwitcher::BDAddr() const
+inline const TBTDevAddr& CPhysicalLinkHelper::BDAddr() const
 	{
 	return iLink.BDAddr();   
 	}
 
-inline TBTBasebandRole CRoleSwitcher::RequestedRole() const
-	{
-	return iRole;
-	}
-
-inline TBool CRoleSwitcher::IsEncryptionDisabledForRoleSwitch() const
-	{
-	return iIsEncryptionDisabledForRoleSwitch;
-	}
-
 #endif //PHYSICALLINKHELPER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetooth/btstack/linkmgr/encryptionkeyrefreshhelper.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -0,0 +1,311 @@
+// Copyright (c) 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"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <bluetooth/logger.h>
+
+#include "encryptionkeyrefreshhelper.h"
+#include "hcifacade.h"
+#include "linkmgr.h"
+
+#ifdef __FLOG_ACTIVE
+_LIT8(KLogComponent, LOG_COMPONENT_LINKMGR);
+#endif
+
+CEncryptionKeyRefresher::CEncryptionKeyRefresher(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink)
+	: CPhysicalLinkHelper(aLinkMgr, aLink)
+	{
+	LOG_FUNC
+	}
+
+CEncryptionKeyRefresher* CEncryptionKeyRefresher::NewL(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink)
+	{
+	LOG_STATIC_FUNC
+	CEncryptionKeyRefresher* self = new(ELeave) CEncryptionKeyRefresher(aLinkMgr, aLink);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+	
+void CEncryptionKeyRefresher::ConstructL()
+	{
+	LOG_FUNC
+	
+	BaseConstructL();
+	
+	iStateFactory = CEncryptionKeyRefresherStateFactory::NewL();
+	iState = &(iStateFactory->GetState(CEncryptionKeyRefresherStateFactory::EIdle));
+	}
+	
+CEncryptionKeyRefresher::~CEncryptionKeyRefresher()
+	{
+	LOG_FUNC
+	}
+
+void CEncryptionKeyRefresher::EncryptionKeyRefreshComplete(TInt aError)
+	{
+	LOG_FUNC
+	iState->EncryptionKeyRefreshComplete(*this, aError);
+	}
+
+void CEncryptionKeyRefresher::TimerExpired()
+	{
+	LOG_FUNC
+	iState->TimerExpired(*this);
+	}
+
+void CEncryptionKeyRefresher::HandleError( TInt aError)
+	{
+	LOG_FUNC
+	iState->Error(*this, aError);
+	}
+
+void CEncryptionKeyRefresher::StartHelper()
+	{
+	LOG_FUNC
+	iState->Start(*this);
+	}
+	
+void CEncryptionKeyRefresher::EventReceived(TBTBasebandEventNotification& aEvent)
+	{
+	LOG_FUNC
+	iState->EventReceived(*this, aEvent);
+	}
+		
+
+//----------------------------------------------------------------------------------
+// STATE FACTORY
+//----------------------------------------------------------------------------------
+
+CEncryptionKeyRefresherStateFactory* CEncryptionKeyRefresherStateFactory::NewL()
+	{
+	LOG_STATIC_FUNC
+	CEncryptionKeyRefresherStateFactory* ret=new (ELeave) CEncryptionKeyRefresherStateFactory();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+void CEncryptionKeyRefresherStateFactory::ConstructL()
+	{
+	LOG_FUNC	
+	iStates[EIdle]					=new (ELeave) TEkrStateIdle(*this);
+	iStates[EDisablingLPM]			=new (ELeave) TEkrStateDisablingLPM(*this);
+	iStates[ERefreshingKey]			=new (ELeave) TEkrStateRefreshingKey(*this);
+	}
+
+CEncryptionKeyRefresherStateFactory::CEncryptionKeyRefresherStateFactory()
+	{
+	LOG_FUNC
+	iStates.DeleteAll();
+	}
+
+const TEncryptionKeyRefresherState& CEncryptionKeyRefresherStateFactory::GetState(CEncryptionKeyRefresherStateFactory::TEncryptionKeyRefresherStates aState) const
+	{
+	LOG_FUNC
+	__ASSERT_DEBUG(iStates[aState],  Panic(EEncryptionKeyRefresherInvalidState));
+	return *iStates[aState];
+	}
+
+TInt CEncryptionKeyRefresherStateFactory::StateIndex(const TEncryptionKeyRefresherState* aState) const
+	{
+	LOG_FUNC
+	TInt state;
+	for (state = 0; state < EEncryptionKeyRefresherMaxState; state++)
+		{
+		if (iStates[state] == aState)
+			{
+			return state;
+			}
+		}
+	
+	return KUnknownState;
+	}
+
+
+//----------------------------------------------------------------------------------
+// STATES
+//----------------------------------------------------------------------------------
+
+TEncryptionKeyRefresherState::TEncryptionKeyRefresherState(CEncryptionKeyRefresherStateFactory& aFactory)
+: iFactory(aFactory)
+	{
+	LOG_FUNC
+	}
+
+void TEncryptionKeyRefresherState::PanicInState(TLinkPanic aPanic) const
+	{
+	LOG_FUNC
+	Panic(aPanic, iFactory.StateIndex(this));
+	}
+
+void TEncryptionKeyRefresherState::ChangeState(CEncryptionKeyRefresher& aContext, CEncryptionKeyRefresherStateFactory::TEncryptionKeyRefresherStates aState) const
+	{
+	LOG_FUNC
+	
+	aContext.iState->Exit(aContext);
+
+#ifdef __FLOG_ACTIVE
+	const TEncryptionKeyRefresherState* state=&iFactory.GetState(aState);
+	LOG2(_L("EncryptionKeyRefresher: State %S -> %S"), &aContext.iState->iName, &state->iName);
+#endif //__FLOG_ACTIVE
+	aContext.iState=&iFactory.GetState(aState);
+
+	aContext.iState->Enter(aContext);
+	}
+
+void TEncryptionKeyRefresherState::Enter(CEncryptionKeyRefresher& /*aContext*/) const
+	{
+	LOG_FUNC
+	// do nothing
+	}
+
+void TEncryptionKeyRefresherState::Exit(CEncryptionKeyRefresher& /*aContext*/) const
+	{
+	LOG_FUNC
+	// do nothing
+	}
+
+void TEncryptionKeyRefresherState::Start(CEncryptionKeyRefresher& /*aContext*/) const
+	{
+	LOG_FUNC
+	PanicInState(EEncryptionKeyRefresherStateMachineInvalidEvent);
+	}
+
+void TEncryptionKeyRefresherState::Error(CEncryptionKeyRefresher& aContext, TInt /*aErr*/) const
+	{
+	LOG_FUNC
+	aContext.CancelNotify();
+	aContext.RemoveTimer();
+	ChangeState(aContext, CEncryptionKeyRefresherStateFactory::EIdle);
+	}
+
+void TEncryptionKeyRefresherState::EventReceived(CEncryptionKeyRefresher& /*aContext*/, TBTBasebandEventNotification& /*aEvent*/) const
+	{
+	LOG_FUNC
+	// do nothing
+	}
+
+void TEncryptionKeyRefresherState::TimerExpired(CEncryptionKeyRefresher& aContext) const
+	{
+	LOG_FUNC
+	aContext.CancelNotify();
+	ChangeState(aContext, CEncryptionKeyRefresherStateFactory::EIdle);
+	}
+
+void TEncryptionKeyRefresherState::EncryptionKeyRefreshComplete(CEncryptionKeyRefresher& /*aContext*/, TInt /*aError*/) const
+	{
+	LOG_FUNC
+	// do nothing
+	}
+
+//----------------------------------------------------------------------------------
+
+TEkrStateIdle::TEkrStateIdle(CEncryptionKeyRefresherStateFactory& aFactory)
+: TEncryptionKeyRefresherState(aFactory)
+	{
+	LOG_FUNC
+	STATENAME("TEkrStateIdle");
+	}
+
+void TEkrStateIdle::Start(CEncryptionKeyRefresher& aContext) const
+	{
+	LOG_FUNC
+	aContext.QueueTimer(KTimeoutEncryptionKeyRefresh);	// watchdog timer
+	ChangeState(aContext, CEncryptionKeyRefresherStateFactory::EDisablingLPM);
+	}	
+
+void TEkrStateIdle::Enter(CEncryptionKeyRefresher& aContext) const
+	{
+	LOG_FUNC
+	// async call to delete the helper
+	aContext.iLink.AsyncDeleteKeyRefresher();
+	}	
+
+//----------------------------------------------------------------------------------
+
+TEkrStateDisablingLPM::TEkrStateDisablingLPM(CEncryptionKeyRefresherStateFactory& aFactory)
+: TEncryptionKeyRefresherState(aFactory)
+	{
+	LOG_FUNC
+	STATENAME("TEkrStateDisablingLPM");
+	}
+
+void TEkrStateDisablingLPM::Enter(CEncryptionKeyRefresher& aContext) const
+	{
+	LOG_FUNC
+	
+	if (aContext.iLink.LinkMode() == EActiveMode)
+		{
+		// Skip straight on to refresh the key
+		ChangeState(aContext, CEncryptionKeyRefresherStateFactory::ERefreshingKey);
+		}
+	else
+		{
+		aContext.NotifyBasebandEvent(ENotifyActiveMode);
+		}
+	
+	// DisableLPM even if link is active to prevent possible LPM requests during key refresh
+	aContext.DisableLPM();
+	}
+
+void TEkrStateDisablingLPM::EventReceived(CEncryptionKeyRefresher& aContext, TBTBasebandEventNotification& aEvent) const
+	{
+	LOG_FUNC
+	if (aEvent.EventType()==ENotifyActiveMode && aEvent.ErrorCode()==KErrNone)
+		{
+		ChangeState(aContext, CEncryptionKeyRefresherStateFactory::ERefreshingKey);
+		}
+	else 
+		{
+		LOG(_L("CEncryptionKeyRefresher failed in DisableLPM"));
+		// If we can't put ourselves into active mode then don't bother with 
+		// refresh, it'll probably cause more problems than it would solve
+		// we can quit SM, don't need to rewind
+		ChangeState(aContext, CEncryptionKeyRefresherStateFactory::EIdle);
+		}
+	}
+
+//----------------------------------------------------------------------------------
+TEkrStateRefreshingKey::TEkrStateRefreshingKey(CEncryptionKeyRefresherStateFactory& aFactory)
+: TEncryptionKeyRefresherState(aFactory)
+	{
+	LOG_FUNC
+	STATENAME("TEkrStateRefreshingKey");
+	}
+
+void TEkrStateRefreshingKey::Enter(CEncryptionKeyRefresher& aContext) const
+	{
+	LOG_FUNC
+	
+	TRAPD(err, aContext.iLinkMgr.HCIFacade().RefreshEncryptionKeyL(aContext.iLink.Handle()));
+	
+	if(err)
+		{
+		ChangeState(aContext, CEncryptionKeyRefresherStateFactory::EIdle);
+		}
+	}
+
+void TEkrStateRefreshingKey::EncryptionKeyRefreshComplete(CEncryptionKeyRefresher& aContext, TInt __DEBUG_ONLY(aError)) const
+	{
+	LOG_FUNC
+	LOG1(_L("EncryptionKeyRefresh completed with error %d"), aError);
+
+	// Don't really care what the error is, this is just a best effort service
+	// anyway
+	ChangeState(aContext, CEncryptionKeyRefresherStateFactory::EIdle);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetooth/btstack/linkmgr/encryptionkeyrefreshhelper.h	Thu Sep 23 17:06:47 2010 +0300
@@ -0,0 +1,169 @@
+// Copyright (c) 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"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef ENCRYPTIONKEYREFRESHHELPER_H
+#define ENCRYPTIONKEYREFRESHHELPER_H
+
+
+#include <bt_sock.h>
+#include <bluetooth/hci/hciutil.h> 
+
+#include "debug.h"
+#include "linkutil.h"
+#include "physicallinkhelper.h"
+#include "physicallinks.h"
+
+// watchdog 
+const TUint KTimeoutEncryptionKeyRefresh =   3000000;  // 3 s; 
+ 
+class TEncryptionKeyRefresherState;
+class CEncryptionKeyRefresherStateFactory;
+NONSHARABLE_CLASS(CEncryptionKeyRefresher) : public CPhysicalLinkHelper
+	{
+	friend class TEncryptionKeyRefresherState;
+	friend class TEkrStateIdle;
+	friend class TEkrStateDisablingLPM;
+	friend class TEkrStateRefreshingKey;
+
+public:
+	static CEncryptionKeyRefresher* NewL(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink);
+	~CEncryptionKeyRefresher();
+
+	virtual void StartHelper();
+	
+	void EncryptionKeyRefreshComplete(TInt aError);
+
+private:
+	CEncryptionKeyRefresher(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink);
+	void ConstructL(); 
+	
+	virtual void TimerExpired();
+	virtual void HandleError(TInt aError);
+	virtual void EventReceived(TBTBasebandEventNotification& aEvent);
+  
+private:
+	CEncryptionKeyRefresherStateFactory*	iStateFactory;
+	const TEncryptionKeyRefresherState*		iState;            
+	};
+
+//--------------------------------------------------
+// STATE FACTORY
+//--------------------------------------------------
+
+/**
+   Factory for the EncryptionKeyRefresher states
+
+   The states are flyweight classes
+**/
+NONSHARABLE_CLASS(CEncryptionKeyRefresherStateFactory) : public CBase
+	{
+public:
+	static CEncryptionKeyRefresherStateFactory* NewL();
+
+	enum TEncryptionKeyRefresherStates
+		{
+		EIdle,
+		EDisablingLPM,
+		ERefreshingKey,
+		// Note that we don't need a state to enable LPM again
+		// as this will happen implicitly when we close our 
+		// proxy SAP.
+		// *** keep next one last ***
+		EEncryptionKeyRefresherMaxState,
+		};
+	
+	const TEncryptionKeyRefresherState& GetState(TEncryptionKeyRefresherStates aState) const;
+	TInt StateIndex(const TEncryptionKeyRefresherState* aState) const;
+	
+private:
+	CEncryptionKeyRefresherStateFactory();
+	void ConstructL();
+	TFixedArray<TEncryptionKeyRefresherState*, EEncryptionKeyRefresherMaxState> iStates;
+	};
+
+
+
+//--------------------------------------------------
+// STATES, base 
+//--------------------------------------------------
+
+NONSHARABLE_CLASS(TEncryptionKeyRefresherState)
+	{
+public:
+	TEncryptionKeyRefresherState(CEncryptionKeyRefresherStateFactory& aFactory);
+	
+	virtual void Enter(CEncryptionKeyRefresher& aContext) const;
+	virtual void Exit(CEncryptionKeyRefresher& aContext) const;
+
+	virtual void Start(CEncryptionKeyRefresher& aContext) const;
+	virtual void EventReceived(CEncryptionKeyRefresher& aContext, TBTBasebandEventNotification& aEvent) const;
+	virtual void Error(CEncryptionKeyRefresher& aContext, TInt aErr) const;
+	virtual void TimerExpired(CEncryptionKeyRefresher& aContext) const;
+	virtual void EncryptionKeyRefreshComplete(CEncryptionKeyRefresher& aContext, TInt aError) const;
+
+protected:
+	// Exits old state, sets the new state, and enters it.
+	void ChangeState(CEncryptionKeyRefresher& aContext, CEncryptionKeyRefresherStateFactory::TEncryptionKeyRefresherStates aState) const;
+	void PanicInState(TLinkPanic aPanic) const;
+	
+protected:
+	CEncryptionKeyRefresherStateFactory& iFactory;
+#ifdef __FLOG_ACTIVE
+	TBuf<48> iName;
+#endif
+	};
+
+
+//--------------------------------------------------
+// STATES 
+//--------------------------------------------------
+
+NONSHARABLE_CLASS(TEkrStateIdle) : public TEncryptionKeyRefresherState
+	{
+public:
+	TEkrStateIdle(CEncryptionKeyRefresherStateFactory& aFactory);
+
+	virtual void Enter(CEncryptionKeyRefresher& aContext) const;
+	virtual void Start(CEncryptionKeyRefresher& aContext) const;
+	};
+
+
+NONSHARABLE_CLASS(TEkrStateDisablingLPM) : public TEncryptionKeyRefresherState
+	{
+public:
+	TEkrStateDisablingLPM(CEncryptionKeyRefresherStateFactory& aFactory);
+
+	virtual void Enter(CEncryptionKeyRefresher& aContext) const;
+	virtual void EventReceived(CEncryptionKeyRefresher& aContext, TBTBasebandEventNotification& aEvent) const;
+	};
+
+NONSHARABLE_CLASS(TEkrStateRefreshingKey) : public TEncryptionKeyRefresherState
+	{
+public:
+	TEkrStateRefreshingKey(CEncryptionKeyRefresherStateFactory& aFactory);
+
+	virtual void Enter(CEncryptionKeyRefresher& aContext) const;
+	virtual void EncryptionKeyRefreshComplete(CEncryptionKeyRefresher& aContext, TInt aError) const;
+	};
+
+
+#ifdef __FLOG_ACTIVE
+#define STATENAME(x)  iName=_L(x)
+#else
+#define STATENAME(x)
+#endif
+
+
+#endif /* ENCRYPTIONKEYREFRESHHELPER_H */
--- a/bluetooth/btstack/linkmgr/hcifacade.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/hcifacade.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -175,19 +175,6 @@
 
 	iAFHTimer=CAFHTimer::NewL(*this);
 	
-	// Read low power mode override timeout from the configuration file
-	_LIT(KLPMSection, "lowpowermodeconfiguration");
-	_LIT(KLPMTag, "overridelpmtimeout_microseconds");
-
-	TUint overrideLPMTimeout = 0;
-	TRAP(err, overrideLPMTimeout = iHciUtil->GetValueFromFileL(KLPMSection, KLPMTag));
-	
-	if (err == KErrNone)
-		{
-		// LPM override timeout found, pass the value into link manager
-		iLinkMgrProtocol.SetOverrideLPMTimeout(overrideLPMTimeout);
-		}
-	
 	iLastPowerState = EBTOn;
 	
 	// used later to ensure that we have enough data to call SetEventMask
--- a/bluetooth/btstack/linkmgr/hcifacade.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/hcifacade.h	Thu Sep 23 17:06:47 2010 +0300
@@ -310,6 +310,7 @@
 	void LinkKeyRequestEvent(const THCIEventBase& aEvent, const CHCICommandBase* aRelatedCommand);
 	void LinkKeyNotificationEvent(const THCIEventBase& aEvent, const CHCICommandBase* aRelatedCommand);
 	void MaxSlotsChangeEvent(const THCIEventBase& aEvent, const CHCICommandBase* aRelatedCommand);
+	void EncryptionKeyRefreshCompleteEvent(const THCIEventBase& aEvent, const CHCICommandBase* aRelatedCommand);
 
 	// Data event processing functions
 	void NumberOfCompletedPacketsEvent(THCIEventBase& aEvent);
--- a/bluetooth/btstack/linkmgr/hcifacade_events.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/hcifacade_events.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -80,6 +80,7 @@
 #include <bluetooth/hci/vendordebugcompleteevent.h>
 #include <bluetooth/hci/writesimplepairingmodecommand.h>
 #include <bluetooth/hci/readlocalsupportedcommandscommand.h>
+#include <bluetooth/hci/encryptionkeyrefreshcompleteevent.h>
 
 
 // Command Complete Events
@@ -1220,6 +1221,14 @@
 	iLinksMgr->MaxSlotsChange(maxSlotsChangeEvent.ConnectionHandle(), maxSlotsChangeEvent.LMPMaxSlots());
 	}
 
+void CHCIFacade::EncryptionKeyRefreshCompleteEvent(const THCIEventBase& aEvent, const CHCICommandBase* /*aRelatedCommand*/)
+	{
+	LOG_FUNC
+	const TEncryptionKeyRefreshCompleteEvent& refreshCompleteEvent = TEncryptionKeyRefreshCompleteEvent::Cast(aEvent);
+
+	iLinksMgr->EncryptionKeyRefreshComplete(aEvent.ErrorCode(), refreshCompleteEvent.ConnectionHandle());
+	}
+
 // ----------------------------------------------------------------------------
 // Data event processing functions
 // ----------------------------------------------------------------------------
@@ -1347,6 +1356,10 @@
 	case EVendorDebugEvent:
 		VendorDebugEvent(aEvent, aRelatedCommand);
 		break;
+		
+	case EEncryptionKeyRefreshCompleteEvent:		
+		EncryptionKeyRefreshCompleteEvent(aEvent, aRelatedCommand);
+		break;
 
 	// Inquiry based events.
 	// By default these should be caused by the inquiry manager and so be returned to it.
@@ -1382,7 +1395,6 @@
 	case EPageScanModeChangeEvent:
 	case EPageScanRepetitionModeChangeEvent:
 	case EUserPasskeyRequestEvent:
-	case EEncryptionKeyRefreshCompleteEvent:		
 		LOG1(_L("Warning!! Unhandled Command Event (event code:%d)"), aEvent.EventCode());
 		break;
 		
--- a/bluetooth/btstack/linkmgr/hostmbufpool.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/hostmbufpool.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -20,6 +20,7 @@
 #include <bluetooth/hci/hcievents.h>
 #include <bluetooth/hci/commandcompleteevent.h>
 #include <bluetooth/hci/hciutil.h>
+#include <bluetooth/hci/hciconsts.h>
 
 #include "linkconsts.h"
 #include "linkutil.h"
--- a/bluetooth/btstack/linkmgr/hostresolver.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/hostresolver.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -524,21 +524,21 @@
 	__ASSERT_DEBUG(iRequestState == EIdle, Panic(EHostResolverTwoRequests));
 	iNameRecord = &aName;
 	iNameRecord->iName.Zero();
-	TInquirySockAddr& sa = TInquirySockAddr::Cast(aName.iAddr);
+	iSockAddr = TInquirySockAddr::Cast(aName.iAddr);
 
-	LOG1(_L("Host Resolver\tAction = %d"),sa.Action());
+	LOG1(_L("Host Resolver\tAction = %d"),iSockAddr.Action());
 
-	if(sa.Action() & KHostResCache)
+	if(iSockAddr.Action() & KHostResCache)
 		//Complete immediately with info if available!
 		{
 		TInt err = KErrNotFound;
-		CBTInqResultRef* ref = iInquiryMgr.FindExistingCacheEntry(sa.BTAddr());
+		CBTInqResultRef* ref = iInquiryMgr.FindExistingCacheEntry(iSockAddr.BTAddr());
 		if (ref)
 			{// Got a result to send up
 			CBTInqResultRecord& rec = ref->Result();
-			rec.GetInquirySockAddr(sa); //Put BT address, CoD etc into 'aName'
+			rec.GetInquirySockAddr(TInquirySockAddr::Cast(aName.iAddr)); //Put BT address, CoD etc into 'aName'
 			// Check whether client wants EIRs instead of names
-			if(sa.Action() & KHostResEir)
+			if(iSockAddr.Action() & KHostResEir)
 				{
 				// Client knows about EIR, we'll fill the TNameRecord with EIR
 				err = rec.GetEir(aName, EFalse);
@@ -565,7 +565,7 @@
 		}
 	
 	// Must request at least one of inquiry or name lookup
-	if (!(sa.Action() & (KHostResInquiry | KHostResName)))
+	if (!(iSockAddr.Action() & (KHostResInquiry | KHostResName)))
 		{
 		iRequestState = EError;
 		CompleteRequest(KErrArgument);
@@ -581,26 +581,26 @@
 		return;
 		}
 
-	iNameLookupMode = (sa.Action()) & KHostResName ? EDoGetNames : EDontGetNames;
-	TBool ignoreCache = (sa.Action() & KHostResIgnoreCache) ? ETrue : EFalse;
+	iNameLookupMode = (iSockAddr.Action()) & KHostResName ? EDoGetNames : EDontGetNames;
+	TBool ignoreCache = (iSockAddr.Action() & KHostResIgnoreCache) ? ETrue : EFalse;
 
-	if (sa.Action() & KHostResInquiry)
+	if (iSockAddr.Action() & KHostResInquiry)
 		{
 		// We only support GIAC and LIAC
-		if (sa.IAC() != KLIAC && sa.IAC() != KGIAC)
+		if (iSockAddr.IAC() != KLIAC && iSockAddr.IAC() != KGIAC)
 			{
 			iRequestState = EError;
 			CompleteRequest(KErrNotSupported);
 			return;
 			}
-		sa.SetBTAddr(TBTDevAddr());
+		iSockAddr.SetBTAddr(TBTDevAddr());
 		iRequestState = EInquiry;
 		if (iInquiryStatus == EInquiryReady)
 			{// Need to start the inquiry process
 			iInquiryStatus = EInquiring;
 			// We set this before calling StartInquiry, as StartInquiry can call InquiryComplete synchronously. 
 			iResults.Reset();
-			iInquiryMgr.StartInquiry(*this, sa.IAC(), ignoreCache);
+			iInquiryMgr.StartInquiry(*this, iSockAddr.IAC(), ignoreCache);
 			}
 		}
 	else // Not an inquiry - just a name lookup
@@ -608,7 +608,7 @@
 		// Just name lookup -- add it to the result set, and request a lookup of it
 		iResults.Reset();
 
-		CBTInqResultRef* ref = iInquiryMgr.AddEntryToCache(sa.BTAddr());
+		CBTInqResultRef* ref = iInquiryMgr.AddEntryToCache(iSockAddr.BTAddr());
 		if(ref)
 			{// This ref is in cache -- need to make our own ref
 			ref = iResults.Add(ref->Result());
@@ -620,7 +620,7 @@
 			}
 		iResults.NextResult(); // Move iter onto first (only) result
 		iRequestState = ENameLookup;
-		iInquiryMgr.LookupName(*this, sa.BTAddr(), ignoreCache, ETrue);
+		iInquiryMgr.LookupName(*this, iSockAddr.BTAddr(), ignoreCache, ETrue);
 		}
 	TryToCompleteRequest();
 	}
@@ -709,8 +709,7 @@
 	if (ref)
 		return;
 
-	TInquirySockAddr& sa = TInquirySockAddr::Cast(iNameRecord->iAddr);
-	if(!aResult.HasRespondedToIAC(sa.IAC()))
+	if(!aResult.HasRespondedToIAC(iSockAddr.IAC()))
 		return; // It's never responded to our IAC, so ignore it
 
 	ref = iResults.Add(aResult);
@@ -723,7 +722,7 @@
 	if(iNameLookupMode == EDoGetNames)
 		{
 		// Find out whether cache was supposed to be ignored from TNameRecord that was passed into GetByAddress() previously
-		TBool ignoreCache = (sa.Action() & KHostResIgnoreCache) ? ETrue : EFalse;
+		TBool ignoreCache = (iSockAddr.Action() & KHostResIgnoreCache) ? ETrue : EFalse;
 		// Handle a "special" case: Cache is to be ignored, but we got the _complete_ name during the inquiry process inside an EIR
 		// (which doesn't count as cached data, since it's freshly arrived from the radio). In this case we don't really want to 
 		// launch a remote name request
@@ -801,13 +800,13 @@
 TUint CBTHostResolver::GetIAC() const
 	{
 	LOG_FUNC
-	if (!iNameRecord)
+	TUint ret = 0;
+	if (iInquiryStatus == EInquiring)
 		{
-		return 0;		// avoid dereferencing a null ptr
+		ret = iSockAddr.IAC(); // Only return IAC if an inquiry is requested
 		}
 	
-	TInquirySockAddr& sa = TInquirySockAddr::Cast(iNameRecord->iAddr);
-	return sa.IAC();
+	return ret;
 	}
 
 TInt CBTHostResolver::SecurityCheck(MProvdSecurityChecker *aSecurityChecker)
@@ -833,8 +832,7 @@
 **/
 	{
 	LOG_FUNC
-	TInquirySockAddr& sa = TInquirySockAddr::Cast(iNameRecord->iAddr);
-	if ((sa.Action() & KHostResInquiry) && iRequestState == EInquiry)
+	if ((iSockAddr.Action() & KHostResInquiry) && iRequestState == EInquiry)
 		{
 		CBTInqResultRef* refNextRes = iResults.NextResult();
 		if (refNextRes)
@@ -845,12 +843,12 @@
 				}
 			else
 				{//Complete!
-				refNextRes->Result().GetInquirySockAddr(sa);
+				refNextRes->Result().GetInquirySockAddr(TInquirySockAddr::Cast(iNameRecord->iAddr));
 				// If EIR was requested and we got one, stick it in the name field
 				TInt err = KErrNone;
-				if(sa.Action() & KHostResEir)
+				if(iSockAddr.Action() & KHostResEir)
 					{
-					err = refNextRes->Result().GetEir(*iNameRecord, (sa.Action() & KHostResIgnoreCache) && !(sa.Action() & KHostResName));
+					err = refNextRes->Result().GetEir(*iNameRecord, (iSockAddr.Action() & KHostResIgnoreCache) && !(iSockAddr.Action() & KHostResName));
 					}
 				else
 					{
@@ -879,7 +877,7 @@
 			}
 		}
 
-	if ((sa.Action() & KHostResName) && iRequestState == ENameLookup)
+	if ((iSockAddr.Action() & KHostResName) && iRequestState == ENameLookup)
 		{
 		CBTInqResultRef* refNextRes = iResults.CurrentResult();
 		if(!refNextRes)
@@ -894,11 +892,11 @@
 			CBTInqResultRecord& rec = refNextRes->Result();
 			if(rec.HaveNameLookupResult() && !rec.IsNameRequestPending() && rec.IsNameComplete())
 				{// Got a name! Complete the request
-				rec.GetInquirySockAddr(sa);
+				rec.GetInquirySockAddr(TInquirySockAddr::Cast(iNameRecord->iAddr));
 				TInt err = rec.NameLookupResultCode();
 				if (err == KErrNone)
 					{// Copy & convert the UTF-8 name over into the result record.
-					if(sa.Action() & KHostResEir)
+					if(iSockAddr.Action() & KHostResEir)
 						{
 						err = rec.GetEir(*iNameRecord, EFalse);
 						}
@@ -912,7 +910,7 @@
 					iNameRecord->iName.Zero();
 					}
 				// Name lookup complete (poss. with errors)
-				if(sa.Action() & KHostResInquiry)
+				if(iSockAddr.Action() & KHostResInquiry)
 					{// Ignore name failures if we're also doing inquiry
 					CompleteRequest(KErrNone);
 					}
@@ -931,7 +929,7 @@
 		{
 		CompleteRequest(KErrHardwareNotAvailable);
 		}
-	if(sa.Action() & KHostResDontBlock)
+	if(iSockAddr.Action() & KHostResDontBlock)
 		{// Complete any outstanding non-blocking operation
 		CompleteRequest(KErrWouldBlock);
 		}
@@ -1047,27 +1045,38 @@
 void CBTInquiryMgr::DeletingHostResolver()
 	{
 	LOG_FUNC
-	// A host resolver is being deleted - we need to check if any other host resolvers want inquiry results from the current IAC.
-	if(!iRequestedInquiryIAC)
+	// A host resolver is being deleted - we need to check if we need to change IAC.
+	// If no host resolver is requesting an inquiry, just let the inquiry run to fill up the cache 
+	TUint requestedIAC = RequestedInquiryIAC();
+	if (iHWState == EInquiry && requestedIAC != 0 && iCurrentInquiryIAC != requestedIAC)
 		{
-		 //No 'current' IAC exists
-		 return;		 
-		}
-	TDblQueIter<CBTHostResolver> iter(iHRs);
-	TBool iacFound=EFalse;
-	while (iter)
-		{
-		if ((iter++)->GetIAC() == iRequestedInquiryIAC)
+		TInt err = CancelHardwareInquiry();
+		if(err==KErrNone)
 			{
-			iacFound = ETrue;
+			SetHWState(ECancellingForNewIAC);
+			iFlusher->Cancel();     // Stop watchdog, start flusher.
 			}
 		}
-	if (!iacFound)
-		{
-		iRequestedInquiryIAC = 0;
-		}
 	}
 
+TUint CBTInquiryMgr::RequestedInquiryIAC()
+    {
+    TUint ret = 0;
+    TDblQueIter<CBTHostResolver> iter(iHRs);
+    CBTHostResolver* hostRes = NULL;
+    while ((hostRes = iter++) != NULL)
+        {
+    	// Only overwrite the requested IAC if:
+    	// - We haven't found a host resolver requesting an IAC yet, or
+    	// - This host resolver requests LIAC, which we prioritise over GIAC
+        if (ret == 0 || hostRes->GetIAC() == KLIAC)
+            {
+            ret = hostRes->GetIAC();
+            }
+        }
+    return ret;
+    }
+
 void CBTInquiryMgr::InquiryResult(TInt aErr,const TInquiryLogEntry& aEntry)
 /**
 	Single Inquiry result received.
@@ -1174,8 +1183,8 @@
 	{
 	LOG_FUNC
 	SetCacheAge(iCurrentInquiryIAC, 0);
-	TUint iacToComplete = iRequestedInquiryIAC;
-	iRequestedInquiryIAC = 0;
+	TUint iacToComplete = iCurrentInquiryIAC;
+	iCurrentInquiryIAC = 0;
 	iFlusher->Cancel(); // Stop watchdog, start flusher
 	SetHWState(EIdle);
 	// don't publish status here, might be doing a name lookup
@@ -1208,10 +1217,8 @@
 		}
 	// Only queue the inquiry if we have completed all the name requests from this one.
 	// Otherwise, it will be issued after all the remote name requests have completed.
-	if (iQueuedInquiryIAC != 0 && iPendingNameRequests == 0)
+	if (RequestedInquiryIAC() != 0 && iPendingNameRequests == 0)
 		{
-		iRequestedInquiryIAC = iQueuedInquiryIAC;
-		iQueuedInquiryIAC = 0;
 		DoInquiry();
 		}
 	}
@@ -1384,11 +1391,6 @@
 
 	// In case we're now free, do inquiry
 	LOG(_L("CBTInquiryMgr::HandleRemoteNameResult asking for another inquiry"));
-	if (iPendingNameRequests == 0 && iRequestedInquiryIAC == 0) // If we've completed the current inquiry, see if we've got another one queued.
-		{
-		iRequestedInquiryIAC = iQueuedInquiryIAC;
-		iQueuedInquiryIAC = 0;
-		}
 	DoInquiry();
 	}
 
@@ -1525,40 +1527,30 @@
 		return;
 		}
 	
-	if (iRequestedInquiryIAC || iQueuedInquiryIAC)
+	if (iCurrentInquiryIAC)
 		{
-		LOG(_L("CBTInquiryMgr::StartInquiry iRequestedInquiryIAC"));
-		if(iRequestedInquiryIAC == aIAC)
+		LOG(_L("CBTInquiryMgr::StartInquiry"));
+        if (aIgnoreCache && (aIAC == iCurrentInquiryIAC || aIAC == KGIAC))
+            {
+            // an Inquiry is ongoing, return any results already found during the
+            // current Inquiry if not already done so as part of the complete cache
+            iCurrentResults.ReturnToFirstResult();
+            while (CBTInqResultRef* ref = iCurrentResults.NextResult())
+                {
+                if (ref->Result().iFoundDuringCurrentInquiry)
+                    {
+                    aResolver.InquiryResult(ref->Result());
+                    }
+                }   
+            }
+		if(iCurrentInquiryIAC == aIAC)
 			{
-			// an Inquiry is ongoing, return any results already found during the
-			// current Inquiry if not already done so as part of the complete cache
-			if (aIgnoreCache)
-				{
-				iCurrentResults.ReturnToFirstResult();
-				while (CBTInqResultRef* ref = iCurrentResults.NextResult())
-					{
-					if (ref->Result().iFoundDuringCurrentInquiry)
-						{
-						aResolver.InquiryResult(ref->Result());
-						}
-					}	
-				}
 			// the current Inquiry will just continue
 			return;			
 			}
-		if (aIAC == KGIAC)
+		if(iHWState == EInquiry && RequestedInquiryIAC() != iCurrentInquiryIAC)
 			{
-			// If the current IAC is GIAC, and the requested inquiry IAC isn't, it must be LIAC
-			__ASSERT_DEBUG(iRequestedInquiryIAC == KLIAC, Panic(EBTUnexpectedIAC)); 
-			// Queue a general inquiry for when the current limited inquiry has finished
-			iQueuedInquiryIAC = aIAC;
-			return;
-			}
-		else if(iHWState == EInquiry)
-			{
-			// The host resolver should only allow through GIAC and LIAC, and we handle GIAC above
-			__ASSERT_DEBUG(aIAC == KLIAC, Panic(EBTUnexpectedIAC)); 
-			// We favour a Limited inqiury, so interrupt the current general inquiry
+			// The requested IAC (which prioritises LIAC) is different to the current IAC, so cancel to change the IAC
 			TInt err = CancelHardwareInquiry();
 			if(err!=KErrNone)
 				{
@@ -1566,23 +1558,12 @@
 				aResolver.InquiryComplete(err); // cancel went wrong
 				return;
 				}
-			// Queue a general inquiry for when the limited inquiry is complete
-			iRequestedInquiryIAC = KLIAC;
-			iQueuedInquiryIAC = KGIAC;
 			SetHWState(ECancellingForNewIAC);
 			iFlusher->Cancel(); 	// Stop watchdog, start flusher.
 			return;
 			}
-		else
-			{
-			// The host resolver should only allow through GIAC and LIAC, and we handle GIAC above
-			__ASSERT_DEBUG(aIAC == KLIAC, Panic(EBTUnexpectedIAC)); 
-			iRequestedInquiryIAC = KLIAC;
-			iQueuedInquiryIAC = KGIAC;
-			}
 		}
 
-	iRequestedInquiryIAC = aIAC;
 	iInquiryInteruptions = 0;
 
 	DoInquiry();
@@ -1802,10 +1783,10 @@
 	{
 	LOG_FUNC
 
-	if(iRequestedInquiryIAC == 0 || iHWState != EIdle || iHRs.IsEmpty())
+	if(RequestedInquiryIAC() == 0 || iHWState != EIdle || iHRs.IsEmpty())
 		{
 #ifdef _DEBUG
-		LOG3(_L("Not starting inquiry. iRequestedInquiryIAC == %d, iHWState == %d, iHostResolverCount == %d"), iRequestedInquiryIAC, iHWState, iNumHRs);
+		LOG3(_L("Not starting inquiry. RequestedInquiryIAC == %d, iHWState == %d, iHostResolverCount == %d"), RequestedInquiryIAC(), iHWState, iNumHRs);
 		if (iHRs.IsEmpty())
 			{
 			LOG(_L("No HRs interested in results - Stopping discovery"));
@@ -1816,6 +1797,10 @@
 			LOG(_L("CBTInquiryMgr::DoInquiry PublishStatus Idle"));	
 			PublishStatus();// make sure the status says we're idle
 			}
+		if (RequestedInquiryIAC() == 0)
+			{
+			iCurrentInquiryIAC = 0;
+			}
 		return;
 		}
 
@@ -1845,7 +1830,7 @@
 		{
 		// Couldn't start inquiry.
 		// Make sure the request is completed.
-		iRequestedInquiryIAC = 0;
+		iCurrentInquiryIAC = 0;
 		InquiryComplete(err, 0);
 		LOG(_L("CBTInquiryMgr::DoInquiry PublishState Idle couldn't start inquiry"));
 		PublishStatus();
@@ -1877,7 +1862,7 @@
 TInt CBTInquiryMgr::StartHardwareInquiry()
 	{
 	LOG_FUNC
-	iCurrentInquiryIAC = iRequestedInquiryIAC;
+	iCurrentInquiryIAC = RequestedInquiryIAC();
 	// attempt to free up baseband space for best performance discovery
 	iLinkMgrProtocol.PhysicalLinksMgr().RequireSlotSpace(); // will *eventually* put connections in hold - we dont wait though
 	TRAPD(err, StartInquiryL(iCurrentInquiryIAC, KInquiryLength, KInquiryMaxResults));
@@ -1923,8 +1908,7 @@
 		CBTInqResultRecord& rec = ref->Result();
 		if(rec.IsNameRequestPending())
 			{
-			if(!iRequestedInquiryIAC ||
-			   rec.NameLookupAttempts() < KMaxNameLookupAttemptsDuringInquiry)
+			if(RequestedInquiryIAC() == 0 || rec.NameLookupAttempts() < KMaxNameLookupAttemptsDuringInquiry)
 				{
 				// We want the first record for the current IAC or a record for an explicit name request.
 				// Failing that, we'll just have the first record
--- a/bluetooth/btstack/linkmgr/hostresolver.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/hostresolver.h	Thu Sep 23 17:06:47 2010 +0300
@@ -305,6 +305,7 @@
 	TDblQueLink iLink;
 	//Mixin providing security checking, This is not an owned variable.
 	MProvdSecurityChecker* iSecurityChecker;
+	TInquirySockAddr	iSockAddr;
 	};
 
 #ifdef CONNECTION_PREEMPTS_INQUIRY
@@ -438,6 +439,8 @@
 	TInt CacheAge(TUint aIAC) const;
 	void SetCacheAge(TUint aIAC, TInt aAge);
 	
+	TUint RequestedInquiryIAC();
+	
 private:
 	MHCICommandQueue*   iCommandQueue;
 
@@ -448,10 +451,6 @@
 	THWState		iHWState;
 	// IAC of the current inquiry
 	TUint			iCurrentInquiryIAC;
-	// IAC of the inquiry that is currently requested by a host resolver, either in progress or about to start
-	TUint			iRequestedInquiryIAC;
-	// IAC of the inquiry that has been put on hold while a higher priority IAC is in progress
-	TUint			iQueuedInquiryIAC;
 	// Number of times we've interrupted the current inquiry
 	TInt			iInquiryInteruptions;
 	// Time since the last inquiry, per IAC
--- a/bluetooth/btstack/linkmgr/linkmgr.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/linkmgr.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -800,12 +800,6 @@
 		}
 	}
 
-void CLinkMgrProtocol::SetOverrideLPMTimeout(TUint aOverrideLPMTimeout)
-	{
-	LOG_FUNC
-	iOverrideLPMTimeout =aOverrideLPMTimeout;
-	}
-
 TInt CLinkMgrProtocol::StartProtocolListening()
 	{
 	LOG_FUNC
@@ -1365,9 +1359,6 @@
 			case EUndoOverridePark:
 				rerr = con->UndoOverridePark();
 				break;
-			case EOverrideLPMWithTimeout:
-				rerr = con->OverrideLPMWithTimeout(iOverrideLPMTimeout);
-				break;
 			case EOverrideLPM:
 				rerr = con->OverrideLPM();
 				break;
--- a/bluetooth/btstack/linkmgr/linkmgr.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/linkmgr.h	Thu Sep 23 17:06:47 2010 +0300
@@ -182,7 +182,6 @@
 
 	void SetLimitedDiscoverableIfChangedL(TBool aOn);
 	void SetLocalVersion(THCIErrorCode aErr, TBTDevHCIVersion aHCIVersion, TBTDevLMPVersion aLMPVersion);
-	void SetOverrideLPMTimeout(TUint aOverrideLPMTimeout);
 	void SetLocalFeatures(THCIErrorCode aErr, const TBTFeatures& aMask);
 	void SetLocalCommands(THCIErrorCode aErr, const TBluetoothHciCommands& aMask);
 	void SetDeviceClassL(TUint32 aCod);
@@ -267,8 +266,6 @@
 
 	RPointerArray<CSubscriber>	iSubscribers;
 
-	TUint 					iOverrideLPMTimeout;
-
 	// protocol state objects
 	TBool                   iClosePending;	// the protocol is closing
 	TDeltaTimerEntry		iIdleTimerEntry;
--- a/bluetooth/btstack/linkmgr/linkutil.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/linkutil.h	Thu Sep 23 17:06:47 2010 +0300
@@ -193,6 +193,8 @@
 	EBTACLSAPUnexpectedSecurityResult		=252,
 	ELinkMgrFlowControlUnexpectedUpdate		=253,
 	ELinkMgrFlowControlChangeOfMind			=254,
+	EEncryptionKeyRefresherInvalidState		=255,
+	EEncryptionKeyRefresherStateMachineInvalidEvent = 256,
 	};
 
 /**
--- a/bluetooth/btstack/linkmgr/physicallinks.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/physicallinks.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -25,10 +25,11 @@
 #include "linkconsts.h"
 #include "hcifacade.h"
 #include "hostresolver.h"
-#include "PhysicalLinkHelper.h"
+#include "roleswitchhelper.h"
 #include "pairingscache.h"
 #include "oobdata.h"
 #include "pairingserver.h"
+#include "encryptionkeyrefreshhelper.h"
 
 #include <bt_sock.h>
 
@@ -91,7 +92,6 @@
 	, iProxySAPs(_FOFF(CBTProxySAP, iQueueLink))
 	, iOverrideParkRequests(EFalse)
 	, iOverrideLPMRequests(EFalse)
-	, iLPMOverrideTimerQueued(EFalse)
 	, iConnectionPacketTypeChanged(EFalse)
 	, iLowPowModeCtrl(*this, iLinksMan.HCIFacade().CommandQController())
 	, iDisconnectCtrl(*this, iLinksMan.HCIFacade().CommandQController())
@@ -119,11 +119,6 @@
 	iACLLogicalLinks.Close();
 
 	RemoveIdleTimer();
-	if (iLPMOverrideTimerQueued)
-		{
-		BTSocketTimer::Remove(iOverrideLPMTimerEntry);
-		iLPMOverrideTimerQueued = EFalse;
-		}
 
 	LOG(_L("sec\tClosing subscribers..."))
 
@@ -149,9 +144,11 @@
 	delete iPasskeyEntry;
 	delete iArbitrationDelay;
 	delete iRoleSwitchCompleteCallBack;
+	delete iKeyRefreshCompleteCallBack;
 	delete iEncryptionEnforcer;
 
 	DeleteRoleSwitcher();
+	DeleteKeyRefresher();
 	}
 
 void CPhysicalLink::ConstructL()
@@ -164,9 +161,9 @@
 	TCallBack cb1(RoleSwitchCompleteCallBack, this);
 	iRoleSwitchCompleteCallBack = new (ELeave)CAsyncCallBack(cb1, EActiveHighPriority);
 
-	TCallBack cb2(OverrideLPMTimeoutCallback, this);
-	iOverrideLPMTimerEntry.Set(cb2);
-
+	TCallBack cb2(KeyRefreshCompleteCallBack, this);
+	iKeyRefreshCompleteCallBack = new (ELeave)CAsyncCallBack(cb2, EActiveHighPriority);
+	
 	iPhysicalLinkMetrics = CPhysicalLinkMetrics::NewL(*this, iLinksMan.HCIFacade().CommandQController());
 	}
 
@@ -237,9 +234,19 @@
 		}
 	else
 		{
-		if (iAutoKeyRefreshQue.IsEmpty())
+		// Only refresh the key if no-one is preventing it and we aren't still 
+		// refreshing the key from a previous request.  Note that although
+		// the previous key refresh may actually have finished if the key
+		// refresher is waiting for async delete we have only just refreshed 
+		// the key and there's no point doing it again.
+		if (iAutoKeyRefreshQue.IsEmpty() && !iKeyRefresher)
 			{
-			TRAP_IGNORE(iLinksMan.HCIFacade().RefreshEncryptionKeyL(iHandle));
+			TRAPD(err, iKeyRefresher = CEncryptionKeyRefresher::NewL(iLinksMan, *this));
+			if(!err)
+				{
+				// Kick off the helper state machine
+				iKeyRefresher->StartHelper();
+				}
 			// If we can't refresh the encryption key, there's not much we can do
 			}
 		XAutoKeyRefreshToken* token = new XAutoKeyRefreshToken();
@@ -1364,6 +1371,17 @@
 	nameChanger->Start(BDAddr(), aName);
 	}
 
+void CPhysicalLink::EncryptionKeyRefreshComplete(THCIErrorCode aErr, THCIConnHandle aConnH)
+	{
+	LOG_FUNC
+	__CHECK_CONNECTION_HANDLE(aConnH);
+
+	if(iKeyRefresher)
+		{
+		iKeyRefresher->EncryptionKeyRefreshComplete(aErr);
+		}
+	}
+
 void CPhysicalLink::Disconnection(THCIErrorCode aErr, THCIConnHandle aConnH, THCIErrorCode aResult)
 	{
 	LOG_FUNC
@@ -2227,22 +2245,6 @@
 	iIdleTimerQueued = EFalse;
 	}
 
-void CPhysicalLink::QueueLPMOverrideTimer(TInt aTimeout)
-/**
-	Queue LPM Override timer entry.
-	When this timer expires, it'll call UndoLPMOverride.
-**/
-	{
-	LOG_FUNC
-	__ASSERT_DEBUG(aTimeout!=0, Panic(EBTPhysicalLinksInvalidArgument));
-	if (iLPMOverrideTimerQueued)
-		{
-		BTSocketTimer::Remove(iOverrideLPMTimerEntry);
-		}
-	BTSocketTimer::Queue(aTimeout, iOverrideLPMTimerEntry);
-	iLPMOverrideTimerQueued = ETrue;
-	}
-
 void CPhysicalLink::NotifyStateChange(TBTBasebandEventNotification& aEvent)
 	{
 	LOG_FUNC
@@ -2664,6 +2666,27 @@
 	iRoleSwitcher = NULL;
 	}
 
+void CPhysicalLink::AsyncDeleteKeyRefresher()
+	{
+	LOG_FUNC
+	iKeyRefreshCompleteCallBack->CallBack();
+	}
+
+/*static*/ TInt CPhysicalLink::KeyRefreshCompleteCallBack(TAny* aPhysicalLink)
+	{
+	LOG_STATIC_FUNC
+	CPhysicalLink* physicalLink = static_cast<CPhysicalLink*>(aPhysicalLink);
+	physicalLink->DeleteKeyRefresher();
+	return EFalse;
+	}
+
+void CPhysicalLink::DeleteKeyRefresher()
+	{
+	LOG_FUNC
+	delete iKeyRefresher;
+	iKeyRefresher = NULL;
+	}
+
 TBool CPhysicalLink::IsEncryptionDisabledForRoleSwitch() const
 /**
 	If link is encrypted, but role switcher temporarily disabled encryption, returns true.
@@ -2711,20 +2734,6 @@
 	return Arbitrate();
 	}
 
-TInt CPhysicalLink::OverrideLPMWithTimeout(TUint aTimeout)
-	{
-	LOG_FUNC
-	if(aTimeout == 0)
-		{
-		return KErrNone; //facility not wanted
-		}
-
-	TInt rerr = OverrideLPM();
-	QueueLPMOverrideTimer(aTimeout);
-
-	return rerr;
-	}
-
 TInt CPhysicalLink::OverrideLPM()
 /**
 	A request has come in that requires us to ensure we are not using
@@ -2739,20 +2748,6 @@
 	return Arbitrate();
 	}
 
-/*static*/ TInt CPhysicalLink::OverrideLPMTimeoutCallback(TAny* aCPhysicalLink)
-	{
-	LOG_STATIC_FUNC	
-	CPhysicalLink* c = reinterpret_cast<CPhysicalLink*>(aCPhysicalLink);
-	TInt err = c->UndoOverrideLPM();
-	//we deliberately ignore this return value because we can't do anything to correct the error situation
-	if (KErrNone != err)
-		{
-		LOG2(_L("Physical link: UndoOverrideLPM returned an error %d on the connection 0x%08x"), err, c);
-		}
-	c->iLPMOverrideTimerQueued = EFalse;
-	return KErrNone;
-	}
-
 TInt CPhysicalLink::UndoOverrideLPM()
 /**
 	A need to ensure we are not in LPM has gone.
--- a/bluetooth/btstack/linkmgr/physicallinks.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/physicallinks.h	Thu Sep 23 17:06:47 2010 +0300
@@ -46,6 +46,7 @@
 class CRoleSwitcher;
 class CBTNumericComparator;
 class CBTPasskeyEntry;
+class CEncryptionKeyRefresher;
 
 enum TPhysicalLinkSimplePairingMode
 	{
@@ -342,7 +343,6 @@
 
 	TInt OverridePark();
 	TInt UndoOverridePark();
-	TInt OverrideLPMWithTimeout(TUint aTimeout);
 	TInt OverrideLPM();
 	TInt UndoOverrideLPM();
 	inline TBool IsParked() const;
@@ -375,7 +375,8 @@
 	virtual void RoleChange(THCIErrorCode aErr, const TBTDevAddr& aAddr, TBTBasebandRole aRole);
 	virtual void ClockOffset(THCIErrorCode aErr, THCIConnHandle aConnH, TBasebandTime aClockOffset);
 	virtual void RemoteName(THCIErrorCode aErr, const TBTDevAddr& aAddr, const TBTDeviceName8& aName);
-	
+	virtual void EncryptionKeyRefreshComplete(THCIErrorCode aErr, THCIConnHandle aConnH);
+
 	void ConnectionComplete(TInt aResult, const TBTConnect& aConn);
 
 	TBool LinkKeyRequestPending();
@@ -412,6 +413,7 @@
 	TBTLinkMode LinkMode() const; 
 	
 	void AsyncDeleteRoleSwitcher();
+	void AsyncDeleteKeyRefresher();
 	
 	inline const TLinkPolicy& LinkPolicy() const;
 	inline const TBTFeatures& RemoteFeatures() const;
@@ -485,7 +487,6 @@
 	void QueueIdleTimer(TInt aTime);
 	void RemoveIdleTimer();
 
-	void QueueLPMOverrideTimer(TInt aTimeout);
 	void NotifyStateChange(TBTBasebandEventNotification & aEvent);
 
 	TBool IsPhysicalLinkIdle() const;
@@ -496,6 +497,9 @@
 	void DeleteRoleSwitcher();
 	static TInt RoleSwitchCompleteCallBack(TAny* CPhysicalLink);
 	TInt ManageEncryptionEnforcement(THCIEncryptModeFlag aEnable);
+	
+	void DeleteKeyRefresher();
+	static TInt KeyRefreshCompleteCallBack(TAny* CPhysicalLink);
 
 	void HandlePrefetch();
 	void PINCodeRequestReply(const TBTDevAddr& aDevAddr,const TDesC8& aPin);
@@ -552,13 +556,11 @@
 	TSglQue<CBTProxySAP>		iProxySAPs;			// the proxies bound to us
 	TDeltaTimerEntry			iIdleTimerEntry;
 	TBool						iIdleTimerQueued;
-	TDeltaTimerEntry			iOverrideLPMTimerEntry;
 
 	TLinkPolicy					iLinkPolicy;
 	TUint16						iPreviousRequestedModeMask;
 	TBool						iOverrideParkRequests; //for maybe temporary unpark
 	TBool						iOverrideLPMRequests; //for maybe temporary force active
-	TBool						iLPMOverrideTimerQueued;
 	TBool						iConnectionPacketTypeChanged; //for triggering h/w 
 	
 	TBool						iPreventLinkKeyUpdateReg; //for case e.g. user has called unpair when there is a paired logical channel
@@ -570,6 +572,8 @@
 	CArbitrationDelayTimer*		iArbitrationDelay; //for lower power modes
 	CRoleSwitcher*				iRoleSwitcher; //class handles role switch, prevents LPM, removes encryption		
 	CAsyncCallBack*				iRoleSwitchCompleteCallBack;// Async Callback to delete role swticher class.
+	CEncryptionKeyRefresher*	iKeyRefresher; //class handles key refresh 
+	CAsyncCallBack*				iKeyRefreshCompleteCallBack;// Async Callback to delete key refresher class.
 
 	TLowPowModeCmdController	iLowPowModeCtrl;
 	CPhysicalLinkMetrics*		iPhysicalLinkMetrics;
--- a/bluetooth/btstack/linkmgr/physicallinksmanager.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/physicallinksmanager.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -23,7 +23,7 @@
 #include "ProxySAP.h"
 
 #include <bt_sock.h>
-#include "PhysicalLinkHelper.h"
+#include "roleswitchhelper.h"
 #include "hostresolver.h"
 
 #include <bluetooth/hci/writepagetimeoutcommand.h>
@@ -583,6 +583,13 @@
 	found->MaxSlotsChange(aConnH, aSlots);
 	}
 
+void CPhysicalLinksManager::EncryptionKeyRefreshComplete(THCIErrorCode aErr, THCIConnHandle aConnH)
+	{
+	CPhysicalLink* found = FindPhysicalLink(aConnH);
+	RETURN_IF_NULL_CONNECTION(found);
+	found->EncryptionKeyRefreshComplete(aErr, aConnH);
+	}
+
 void CPhysicalLinksManager::ModeChange(THCIErrorCode aErr, THCIConnHandle aConnH, TBTLinkMode aMode, TBasebandTime aInterval)
 	{
 	CPhysicalLink* found = FindPhysicalLink(aConnH);
@@ -996,7 +1003,7 @@
  		// this the only role request, it's safe to kick off the state machine
  		// first suspend host resolver
  		LinkManagerProtocol().InquiryMgr().Suspend();
- 		aRoleSwitcher.Start();
+ 		aRoleSwitcher.StartHelper();
  		}
  	}
  
@@ -1016,7 +1023,7 @@
  	
  	if (startNextRoleSwitcher && !iRoleSwitchersQ.IsEmpty())
  		{
- 		iRoleSwitchersQ.First()->Start();
+ 		iRoleSwitchersQ.First()->StartHelper();
  		}
  	else 
  		{
--- a/bluetooth/btstack/linkmgr/physicallinksmanager.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/linkmgr/physicallinksmanager.h	Thu Sep 23 17:06:47 2010 +0300
@@ -204,6 +204,8 @@
 	virtual void ClockOffset(THCIErrorCode aErr, THCIConnHandle aConnH, TBasebandTime aClockOffset);
 	virtual void RemoteName(THCIErrorCode aErr, const TBTDevAddr& aAddr, const TBTDeviceName8& aName);
 	virtual void SimplePairingComplete(const TBTDevAddr& aBDAddr, THCIErrorCode aErr);
+	virtual void EncryptionKeyRefreshComplete(THCIErrorCode aErr, THCIConnHandle aConnH);
+
 
 // events from MBTPairingsCacheObserver
 	virtual void MbpcoDeferredDecisionResolved(TInt aError);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetooth/btstack/linkmgr/roleswitchhelper.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -0,0 +1,518 @@
+// Copyright (c) 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"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#include <bluetooth/logger.h>
+#include "roleswitchhelper.h"
+#include "physicallinksmanager.h"
+#include "AclDataQController.h"
+#include "ProxySAP.h"
+#include "linkmgr.h"
+
+#ifdef __FLOG_ACTIVE
+_LIT8(KLogComponent, LOG_COMPONENT_LINKMGR);
+#endif
+
+CRoleSwitcher::CRoleSwitcher(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink, TBTBasebandRole aRole)
+	: CPhysicalLinkHelper(aLinkMgr, aLink)
+	, iRole(aRole)
+	, iIsEncryptionDisabledForRoleSwitch(EFalse)
+	{
+	LOG_FUNC
+	iState = &iLinkMgr.RoleSwitcherStateFactory().GetState(CRoleSwitcherStateFactory::EIdle);
+	}
+
+CRoleSwitcher* CRoleSwitcher::NewL(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink, TBTBasebandRole aRole)
+	{
+	LOG_STATIC_FUNC
+	CRoleSwitcher* self = new(ELeave) CRoleSwitcher(aLinkMgr, aLink, aRole);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+	
+void CRoleSwitcher::ConstructL()
+	{
+	LOG_FUNC
+	
+	BaseConstructL();
+	
+	// add ourselves to the list in LinkMgr, LinkMgr will kick off the role change state machine 	
+	iLinkMgr.AddRoleSwitcher(*this);
+	iAddedToLinkMgr = ETrue;
+	}
+	
+CRoleSwitcher::~CRoleSwitcher()
+	{
+	LOG_FUNC
+	if (iAddedToLinkMgr)
+		{
+		iLinkMgr.RemoveRoleSwitcher(*this);
+		}
+	}
+
+void CRoleSwitcher::TimerExpired()
+	{
+	LOG_FUNC
+	
+	iState->TimerExpired(*this);
+	}
+
+void CRoleSwitcher::HandleError( TInt aError)
+	{
+	LOG_FUNC
+	
+	iState->Error(*this, aError);
+	}
+
+void CRoleSwitcher::DisableEncryption()
+  	{
+	LOG_FUNC
+ 	// data traffic suspended
+	iLinkMgr.LinkManagerProtocol().ACLController().SetParked(iLink.Handle(), ETrue);
+	NotifyBasebandEvent(ENotifyEncryptionChangeOff);
+	iLinkMgr.Encrypt(EFalse, iLink);
+
+	// set flag here, it's too late when we receive the event as AccessReqester
+	// might receive the baseband notification earlier then the flag is set!	
+	iIsEncryptionDisabledForRoleSwitch = ETrue;
+  	}
+
+void CRoleSwitcher::EnableEncryption()
+  	{
+	LOG_FUNC  	
+	NotifyBasebandEvent(ENotifyEncryptionChangeOn);
+	iLinkMgr.Encrypt(ETrue, iLink);	
+	// data traffic is enabled in IoctlComplete
+  	}
+   	
+void CRoleSwitcher::ChangeRole()
+	{
+	LOG_FUNC
+	NotifyBasebandEvent(ENotifyAnyRole);
+	iLinkMgr.ChangeRole(iRole, iLink);
+	}
+
+void CRoleSwitcher::StartHelper()
+	{
+	LOG_FUNC
+	iState->Start(*this);
+	}
+		
+void CRoleSwitcher::SaveEncryption()
+	{
+	LOG_FUNC
+	iIsEncrypted = iLink.Encrypted();
+	}
+
+void CRoleSwitcher::LogRoleSwitchSuccessful(TBTBasebandEventNotification& aEvent) const
+	{
+	LOG_FUNC
+	TInt eventType;
+	eventType = (iRole == EMaster ? ENotifyMaster :ENotifySlave);
+	
+	if (aEvent.EventType()==eventType && aEvent.ErrorCode()==KErrNone)
+		{
+		LOG(_L("CRoleSwitcher RoleSwitch OK"));	
+		}
+	else 
+		{
+		LOG(_L("CRoleSwitcher RoleSwitch failed"));
+		}
+	}
+	
+void CRoleSwitcher::EventReceived(TBTBasebandEventNotification& aEvent)
+	{
+	LOG_FUNC
+	iState->EventReceived(*this, aEvent);
+	}
+		
+
+//----------------------------------------------------------------------------------
+// STATE FACTORY
+//----------------------------------------------------------------------------------
+
+CRoleSwitcherStateFactory* CRoleSwitcherStateFactory::NewL()
+	{
+	LOG_STATIC_FUNC
+	CRoleSwitcherStateFactory* ret=new (ELeave) CRoleSwitcherStateFactory();
+	CleanupStack::PushL(ret);
+	ret->ConstructL();
+	CleanupStack::Pop(ret);
+	return ret;
+	}
+
+void CRoleSwitcherStateFactory::ConstructL()
+	{
+	LOG_FUNC	
+	iStates[EIdle]					=new (ELeave) TRSStateIdle(*this);
+	iStates[EDisablingLPM]			=new (ELeave) TRSStateDisablingLPM(*this);
+	iStates[EDisablingEncryption]	=new (ELeave) TRSStateDisablingEncryption(*this);
+	iStates[EChangingRole]			=new (ELeave) TRSStateChangingRole(*this);
+	iStates[EChangingRoleWithEPR]	=new (ELeave) TRSStateChangingRoleWithEPR(*this);
+	iStates[EEnablingEncryption]	=new (ELeave) TRSStateEnablingEncryption(*this);
+	}
+
+CRoleSwitcherStateFactory::CRoleSwitcherStateFactory()
+	{
+	LOG_FUNC
+	iStates.DeleteAll();
+	}
+
+TRoleSwitcherState& CRoleSwitcherStateFactory::GetState(CRoleSwitcherStateFactory::TRoleSwitcherStates aState)
+	{
+	LOG_FUNC
+	__ASSERT_DEBUG(iStates[aState],  Panic(ERoleSwitcherInvalidState));
+	return *iStates[aState];
+	}
+
+TInt CRoleSwitcherStateFactory::StateIndex(const TRoleSwitcherState* aState) const
+	{
+	LOG_FUNC
+	TInt state;
+	for (state = 0; state < ERoleSwitcherMaxState; state++)
+		{
+		if (iStates[state] == aState)
+			{
+			return state;
+			}
+		}
+	
+	return KUnknownState;
+	}
+
+
+//----------------------------------------------------------------------------------
+// STATES
+//----------------------------------------------------------------------------------
+
+TRoleSwitcherState::TRoleSwitcherState(CRoleSwitcherStateFactory& aFactory)
+: iFactory(aFactory)
+	{
+	LOG_FUNC
+	}
+
+void TRoleSwitcherState::PanicInState(TLinkPanic aPanic) const
+	{
+	LOG_FUNC
+	Panic(aPanic, iFactory.StateIndex(this));
+	}
+
+void TRoleSwitcherState::ChangeState(CRoleSwitcher& aContext, CRoleSwitcherStateFactory::TRoleSwitcherStates aState) const
+	{
+	LOG_FUNC
+	
+	aContext.iState->Exit(aContext);
+
+#ifdef __FLOG_ACTIVE
+	TRoleSwitcherState* state=&iFactory.GetState(aState);
+	LOG2(_L("RoleSwitcher: State %S -> %S"), &aContext.iState->iName, &state->iName);
+#endif //__FLOG_ACTIVE
+	aContext.iState=&iFactory.GetState(aState);
+
+	aContext.iState->Enter(aContext);
+	}
+
+void TRoleSwitcherState::Enter(CRoleSwitcher& /*aContext*/) const
+	{
+	LOG_FUNC
+	// do nothing
+	}
+
+void TRoleSwitcherState::Exit(CRoleSwitcher& /*aContext*/) const
+	{
+	LOG_FUNC
+	// do nothing
+	}
+
+void TRoleSwitcherState::Start(CRoleSwitcher& /*aContext*/) const
+	{
+	LOG_FUNC
+	PanicInState(ERoleSwitcherStateMachineInvalidEvent);
+	}
+
+void TRoleSwitcherState::Error(CRoleSwitcher& aContext, TInt /*aErr*/) const
+	{
+	LOG_FUNC
+	aContext.CancelNotify();
+	aContext.RemoveTimer();
+	ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
+	}
+
+void TRoleSwitcherState::EventReceived(CRoleSwitcher& /*aContext*/, TBTBasebandEventNotification& /*aEvent*/) const
+	{
+	LOG_FUNC
+	// do nothing
+	}
+
+void TRoleSwitcherState::TimerExpired(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
+	}
+
+//----------------------------------------------------------------------------------
+
+TRSStateIdle::TRSStateIdle(CRoleSwitcherStateFactory& aFactory)
+: TRoleSwitcherState(aFactory)
+	{
+	LOG_FUNC
+	STATENAME("TRSStateIdle");
+	}
+
+void TRSStateIdle::Start(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	aContext.QueueTimer(KTimeoutRoleSwitch);	// watchdog timer
+	ChangeState(aContext, CRoleSwitcherStateFactory::EDisablingLPM);
+	}	
+
+void TRSStateIdle::Enter(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	// async call to delete the helper
+	aContext.iLink.AsyncDeleteRoleSwitcher();
+	}	
+
+//----------------------------------------------------------------------------------
+
+TRSStateDisablingLPM::TRSStateDisablingLPM(CRoleSwitcherStateFactory& aFactory)
+: TRoleSwitcherState(aFactory)
+	{
+	LOG_FUNC
+	STATENAME("TRSStateDisablingLPM");
+	}
+
+void TRSStateDisablingLPM::Enter(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	// DisableLPM even if link is active to prevent possible LPM requests during encryption disabling
+
+	if (aContext.iLink.LinkMode() == EActiveMode)
+		{
+		aContext.DisableLPM();
+		if (aContext.IsEPRSupported())
+			{
+			ChangeState(aContext, CRoleSwitcherStateFactory::EChangingRoleWithEPR);
+			}
+		else
+			{
+			ChangeState(aContext, CRoleSwitcherStateFactory::EDisablingEncryption);
+			}
+		// don't wait for notification
+		}
+	else
+		{
+		aContext.NotifyBasebandEvent(ENotifyActiveMode);
+		aContext.DisableLPM();
+		}
+	}
+
+void TRSStateDisablingLPM::EventReceived(CRoleSwitcher& aContext, TBTBasebandEventNotification& aEvent) const
+	{
+	LOG_FUNC
+	if (aEvent.EventType()==ENotifyActiveMode && aEvent.ErrorCode()==KErrNone)
+		{
+		if (aContext.IsEPRSupported())
+			{
+			ChangeState(aContext, CRoleSwitcherStateFactory::EChangingRoleWithEPR);
+			}
+		else
+			{
+			ChangeState(aContext, CRoleSwitcherStateFactory::EDisablingEncryption);
+			}
+		}
+	else 
+		{
+		LOG(_L("CRoleSwitcher RoleSwitch failed in DisableLPM"));
+		// we can quit SM, don't need to rewind
+		ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
+		}
+	}
+
+//----------------------------------------------------------------------------------
+TRSStateDisablingEncryption::TRSStateDisablingEncryption(CRoleSwitcherStateFactory& aFactory)
+: TRoleSwitcherState(aFactory)
+	{
+	LOG_FUNC
+	STATENAME("TRSStateDisablingEncryption");
+	}
+
+void TRSStateDisablingEncryption::Enter(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	aContext.SaveEncryption();
+	if (aContext.iIsEncrypted)
+		{
+		aContext.DisableEncryption();
+		}
+	else
+		{
+		ChangeState(aContext, CRoleSwitcherStateFactory::EChangingRole);
+		}
+	}
+
+void TRSStateDisablingEncryption::EventReceived(CRoleSwitcher& aContext, TBTBasebandEventNotification& aEvent) const
+	{
+	LOG_FUNC
+	if (aEvent.EventType()==ENotifyEncryptionChangeOff && aEvent.ErrorCode()==KErrNone)
+		{
+		ChangeState(aContext, CRoleSwitcherStateFactory::EChangingRole);
+		}
+	else 
+		{
+		LOG(_L("CRoleSwitcher RoleSwitch failed in DisableEncryption"));
+		// before quiting SM , try to enable LPM
+		ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
+		}
+	}
+
+void TRSStateDisablingEncryption::TimerExpired(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	aContext.CancelNotify();
+	ChangeState(aContext, CRoleSwitcherStateFactory::EEnablingEncryption);
+	}
+
+//----------------------------------------------------------------------------------
+TRSStateChangingRole::TRSStateChangingRole(CRoleSwitcherStateFactory& aFactory)
+: TRoleSwitcherState(aFactory)
+	{
+	LOG_FUNC
+	STATENAME("TRSStateChangingRole");
+	}
+
+void TRSStateChangingRole::Enter(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	aContext.ChangeRole();
+	}
+
+void TRSStateChangingRole::EventReceived(CRoleSwitcher& aContext, TBTBasebandEventNotification& __DEBUG_ONLY(aEvent)) const
+	{
+	LOG_FUNC
+	aContext.RemoveTimer();	// cancel watchdog timer
+
+	FTRACE(aContext.LogRoleSwitchSuccessful(aEvent));
+	
+
+	ChangeState(aContext, CRoleSwitcherStateFactory::EEnablingEncryption);
+	}
+
+void TRSStateChangingRole::TimerExpired(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	aContext.CancelNotify();
+	ChangeState(aContext, CRoleSwitcherStateFactory::EEnablingEncryption);
+	}
+
+//----------------------------------------------------------------------------------
+TRSStateChangingRoleWithEPR::TRSStateChangingRoleWithEPR(CRoleSwitcherStateFactory& aFactory)
+: TRoleSwitcherState(aFactory)
+	{
+	LOG_FUNC
+	STATENAME("TRSStateChangingRoleWithEPR");
+	}
+
+void TRSStateChangingRoleWithEPR::Enter(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	aContext.ChangeRole();
+	}
+
+void TRSStateChangingRoleWithEPR::EventReceived(CRoleSwitcher& aContext, TBTBasebandEventNotification& __DEBUG_ONLY(aEvent)) const
+	{
+	LOG_FUNC
+	aContext.RemoveTimer();	// cancel watchdog timer
+
+	FTRACE(aContext.LogRoleSwitchSuccessful(aEvent));
+		
+	ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
+	}
+
+void TRSStateChangingRoleWithEPR::TimerExpired(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	aContext.CancelNotify();
+	ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
+	}
+
+//----------------------------------------------------------------------------------
+TRSStateEnablingEncryption::TRSStateEnablingEncryption(CRoleSwitcherStateFactory& aFactory)
+: TRoleSwitcherState(aFactory)
+	{
+	LOG_FUNC
+	STATENAME("TRSStateEnablingEncryption");
+	}
+
+void TRSStateEnablingEncryption::Enter(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	if (aContext.iIsEncrypted)
+		{
+		aContext.QueueTimer(KTimeoutOneCommand);
+		aContext.EnableEncryption();
+		}
+	else
+		{
+		ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
+		}
+	}
+	
+void TRSStateEnablingEncryption::Exit(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	if (aContext.iIsEncrypted)
+		{
+		// enable data traffic
+		aContext.iLinkMgr.LinkManagerProtocol().ACLController().SetParked(aContext.iLink.Handle(), EFalse);
+		}
+	}
+
+void TRSStateEnablingEncryption::EventReceived(CRoleSwitcher& aContext, TBTBasebandEventNotification& aEvent) const
+	{
+	LOG_FUNC
+	aContext.RemoveTimer(); // watchdog timer
+	if (aEvent.EventType()==ENotifyEncryptionChangeOn && aEvent.ErrorCode()==KErrNone)
+		{	
+		ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
+		aContext.iIsEncryptionDisabledForRoleSwitch = EFalse;
+		}
+	else 
+		{
+		LOG(_L("CRoleSwitcher SetEncryption failed, disconnect link"));
+		if (aContext.iLink.Terminate(ERemoteUserEndedConnection) != KErrNone) 
+			{
+			LOG(_L("CRoleSwitcher OOM"));
+			}
+		ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
+		}
+	}
+
+void TRSStateEnablingEncryption::TimerExpired(CRoleSwitcher& aContext) const
+	{
+	LOG_FUNC
+	LOG(_L("CRoleSwitcher Timeout in EncryptionEnable, disconnect"));
+	aContext.CancelNotify();			
+	if (aContext.iLink.Terminate(ERemoteUserEndedConnection) != KErrNone)
+			{
+			LOG(_L("CRoleSwitcher OOM"));
+			}
+	ChangeState(aContext, CRoleSwitcherStateFactory::EIdle);
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bluetooth/btstack/linkmgr/roleswitchhelper.h	Thu Sep 23 17:06:47 2010 +0300
@@ -0,0 +1,230 @@
+// Copyright (c) 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"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef ROLESWITCHHELPER_H
+#define ROLESWITCHHELPER_H
+
+#include <bt_sock.h>
+#include <bluetooth/hci/hciutil.h> 
+
+#include "debug.h"
+#include "linkutil.h"
+#include "physicallinkhelper.h"
+#include "physicallinks.h"
+
+// watchdog for first half of the SM including:
+// DisablingLPM, DisablingEncryption, RoleSwitch
+const TUint KTimeoutRoleSwitch =   3000000;  // 3 s; 
+
+// watchdog for EnablingEncryption
+const TUint KTimeoutOneCommand =   2000000;  // 2 s;
+ 
+class TRoleSwitcherState;
+
+NONSHARABLE_CLASS(CRoleSwitcher) : public CPhysicalLinkHelper
+	{
+	friend class TRoleSwitcherState;
+	friend class TRSStateIdle;
+	friend class TRSStateDisablingLPM;
+	friend class TRSStateDisablingEncryption;
+	friend class TRSStateChangingRole;
+	friend class TRSStateChangingRoleWithEPR;
+	friend class TRSStateEnablingEncryption;
+
+public:
+	static CRoleSwitcher* NewL(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink, TBTBasebandRole aRole);
+	~CRoleSwitcher();
+
+	virtual void StartHelper();
+	
+	inline TBool IsEncryptionDisabledForRoleSwitch() const;
+	inline TBTBasebandRole RequestedRole() const;
+
+	TSglQueLink   iQLink;
+
+private:
+	CRoleSwitcher(CPhysicalLinksManager& aLinkMgr, CPhysicalLink& aLink, TBTBasebandRole aRole);
+	void ConstructL(); 
+	
+	virtual void TimerExpired();
+	virtual void HandleError(TInt aError);
+	virtual void EventReceived(TBTBasebandEventNotification& aEvent);
+
+	void DisableEncryption();
+	void ChangeRole();
+	void EnableEncryption();
+	void SaveEncryption();
+	
+	void LogRoleSwitchSuccessful(TBTBasebandEventNotification& aEvent) const;
+
+	TBool					iIsEncrypted;
+	TBool					iIsActive;  // LinkMode
+	TBool					iAddedToLinkMgr;
+	TBTBasebandRole			iRole;  // Requested role    
+	TRoleSwitcherState*		iState;
+	TBool					iIsEncryptionDisabledForRoleSwitch;             
+	};
+
+//--------------------------------------------------
+// STATE FACTORY
+//--------------------------------------------------
+
+/**
+   Factory for the RoleSwitcher states
+
+   The states are flyweight classes
+**/
+NONSHARABLE_CLASS(CRoleSwitcherStateFactory) : public CBase
+	{
+public:
+	static CRoleSwitcherStateFactory* NewL();
+
+	enum TRoleSwitcherStates
+		{
+		EIdle,
+		EDisablingLPM,
+		EDisablingEncryption,
+		EChangingRole,
+		EChangingRoleWithEPR,
+		EEnablingEncryption,
+		// Note that we don't need a state to enable LPM again
+		// as this will happen implicitly when we close our 
+		// proxy SAP.
+	// *** keep next one last ***
+		ERoleSwitcherMaxState,
+		};
+	
+	TRoleSwitcherState& GetState(TRoleSwitcherStates aState);
+	TInt StateIndex(const TRoleSwitcherState* aState) const;
+	
+private:
+	CRoleSwitcherStateFactory();
+	void ConstructL();
+	TFixedArray<TRoleSwitcherState*, ERoleSwitcherMaxState> iStates;
+	};
+
+
+
+//--------------------------------------------------
+// STATES, base 
+//--------------------------------------------------
+
+NONSHARABLE_CLASS(TRoleSwitcherState)
+	{
+public:
+	TRoleSwitcherState(CRoleSwitcherStateFactory& aFactory);
+	
+	virtual void Enter(CRoleSwitcher& aContext) const;
+	virtual void Exit(CRoleSwitcher& aContext) const;
+
+	virtual void Start(CRoleSwitcher& aContext) const;
+	virtual void EventReceived(CRoleSwitcher& aContext, TBTBasebandEventNotification& aEvent) const;
+	virtual void Error(CRoleSwitcher& aContext, TInt aErr) const;
+	virtual void TimerExpired(CRoleSwitcher& aContext) const;
+
+protected:
+	// Exits old state, sets the new state, and enters it.
+	void ChangeState(CRoleSwitcher& aContext, CRoleSwitcherStateFactory::TRoleSwitcherStates aState) const;
+	void PanicInState(TLinkPanic aPanic) const;
+	
+protected:
+	CRoleSwitcherStateFactory& iFactory;
+#ifdef __FLOG_ACTIVE
+	TBuf<48> iName;
+#endif
+	};
+
+
+//--------------------------------------------------
+// STATES 
+//--------------------------------------------------
+
+NONSHARABLE_CLASS(TRSStateIdle) : public TRoleSwitcherState
+	{
+public:
+	TRSStateIdle(CRoleSwitcherStateFactory& aFactory);
+
+	virtual void Enter(CRoleSwitcher& aContext) const;
+	virtual void Start(CRoleSwitcher& aContext) const;
+	};
+
+
+NONSHARABLE_CLASS(TRSStateDisablingLPM) : public TRoleSwitcherState
+	{
+public:
+	TRSStateDisablingLPM(CRoleSwitcherStateFactory& aFactory);
+
+	virtual void Enter(CRoleSwitcher& aContext) const;
+	virtual void EventReceived(CRoleSwitcher& aContext, TBTBasebandEventNotification& aEvent) const;
+	};
+
+NONSHARABLE_CLASS(TRSStateDisablingEncryption) : public TRoleSwitcherState
+	{
+public:
+	TRSStateDisablingEncryption(CRoleSwitcherStateFactory& aFactory);
+
+	virtual void Enter(CRoleSwitcher& aContext) const;
+	virtual void EventReceived(CRoleSwitcher& aContext, TBTBasebandEventNotification& aEvent) const;
+	virtual void TimerExpired(CRoleSwitcher& aContext) const;
+	};
+
+NONSHARABLE_CLASS(TRSStateChangingRole) : public TRoleSwitcherState
+	{
+public:
+	TRSStateChangingRole(CRoleSwitcherStateFactory& aFactory);
+
+	virtual void Enter(CRoleSwitcher& aContext) const;
+	virtual void EventReceived(CRoleSwitcher& aContext, TBTBasebandEventNotification& aEvent) const;
+	virtual void TimerExpired(CRoleSwitcher& aContext) const;
+	};
+
+NONSHARABLE_CLASS(TRSStateChangingRoleWithEPR) : public TRoleSwitcherState
+	{
+public:
+	TRSStateChangingRoleWithEPR(CRoleSwitcherStateFactory& aFactory);
+
+	virtual void Enter(CRoleSwitcher& aContext) const;
+	virtual void EventReceived(CRoleSwitcher& aContext, TBTBasebandEventNotification& aEvent) const;
+	virtual void TimerExpired(CRoleSwitcher& aContext) const;
+	};
+
+NONSHARABLE_CLASS(TRSStateEnablingEncryption) : public TRoleSwitcherState
+	{
+public:
+	TRSStateEnablingEncryption(CRoleSwitcherStateFactory& aFactory);
+
+	virtual void Enter(CRoleSwitcher& aContext) const;
+	virtual void Exit(CRoleSwitcher& aContext) const;   
+	virtual void EventReceived(CRoleSwitcher& aContext, TBTBasebandEventNotification& aEvent) const;
+	virtual void TimerExpired(CRoleSwitcher& aContext) const;
+	};
+
+#ifdef __FLOG_ACTIVE
+#define STATENAME(x)  iName=_L(x)
+#else
+#define STATENAME(x)
+#endif
+
+inline TBTBasebandRole CRoleSwitcher::RequestedRole() const
+	{
+	return iRole;
+	}
+
+inline TBool CRoleSwitcher::IsEncryptionDisabledForRoleSwitch() const
+	{
+	return iIsEncryptionDisabledForRoleSwitch;
+	}
+
+#endif /* ROLESWITCHHELPER_H */
--- a/bluetooth/btstack/rfcomm/rfcommmuxchannel.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/rfcomm/rfcommmuxchannel.h	Thu Sep 23 17:06:47 2010 +0300
@@ -110,7 +110,6 @@
 private:
 	TInt TransmitSABM();
 	TInt TransmitUA();
-	TInt TransmitDISC();
 	TInt TransmitDM();
 	TInt TransmitPN(TBool aCommand, const TRfcommPortParams& aParams);
 	void QueIdleTimer(TInt aDelay);
--- a/bluetooth/btstack/rfcomm/rfcommmuxchannel.inl	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/rfcomm/rfcommmuxchannel.inl	Thu Sep 23 17:06:47 2010 +0300
@@ -102,11 +102,6 @@
 	return iMux.TransmitUA(KMuxDLCI);
 	}
 
-inline TInt CRfcommMuxChannel::TransmitDISC()
-	{
-	return iMux.TransmitDISC(KMuxDLCI);
-	}
-
 inline TInt CRfcommMuxChannel::TransmitDM()
 	{
 	return iMux.TransmitDM(KMuxDLCI, ETrue);
--- a/bluetooth/btstack/rfcomm/rfcommmuxer.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/rfcomm/rfcommmuxer.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -2347,6 +2347,10 @@
 	**/
 	{
 	LOG1(_L("RFCOMM: Sending SABM for DLCI %d"), aDLCI); 
+	// We always expect a response for a SABM, so this frame should
+	// be associated with a SAP or be sent by the mux channel.
+	__ASSERT_DEBUG(aSAP || (aDLCI == KMuxDLCI), Panic(ERfCommNothingToHandleResponse));
+	
 	CRfcommCtrlFrame* frm=NewFrame(aSAP);
 	
 	if(!frm)
@@ -2401,12 +2405,22 @@
 TInt CRfcommMuxer::TransmitDISC(TUint8 aDLCI, CRfcommSAP* aSAP)
 	{
 	LOG1(_L("RFCOMM: Sending DISC for DLCI %d"), aDLCI); 
+	// In setting the response needed flag we assume that only SAPs 
+	// will send a DISC, not the mux channel.  If this changes in the 
+	// future then the condition on setting the response needed flag 
+	// needs reconsidering to deal with this.
+	__ASSERT_DEBUG(aDLCI != KMuxDLCI, Panic(ERfCommDiscSentOnMuxDlci));
+
 	CRfcommCtrlFrame* frm=NewFrame(aSAP);
 	if(!frm)
 		return KErrNoMemory;
 
+	// We only wait for a response for a DISC if there's going to 
+	// be something still around to receive it, otherwise we'll just 
+	// ignore the response when it comes in.
+	frm->SetResponseNeeded(aSAP ? ETrue : EFalse);
+	
 	// DISC always has Final set
-	frm->SetResponseNeeded(ETrue);
 	frm->SetControl(KDISCCtrlField | KPollFinalBitmask);
 	frm->SetAddress(BuildAddr(aDLCI, ETrue));  // C/R set
 	EnqueFrame(frm);
@@ -2450,6 +2464,13 @@
 	
 	__ASSERT_DEBUG(aLen == KRPNCommandLength || aLen == KRPNRequestLength || 
 				   aLen == KRPNResponseLength,	Panic(ERfcommInvalidRPNLength));
+	// We never expect an RPN on the mux channel
+	__ASSERT_DEBUG(aDLCI != KMuxDLCI, Panic(ERfCommUnexpectedCommandOnMuxChannel));
+	
+	// We always expect a response for an RPN command frame, so this frame should
+	// be associated with a SAP.
+	__ASSERT_DEBUG(!aCommand || aSAP, Panic(ERfCommNothingToHandleResponse));
+
 	LOG(_L("RFCOMM: Creating RPN frame"));
 	frm=NewSignalFrame(aLen, aCommand, aSAP);
 	if(!frm)
@@ -2679,6 +2700,14 @@
 	{
 	LOG3(_L("RFCOMM: Sending PN %S for dlci %d (MTU=%d)"), 
 		(aCommand?&KCommandText:&KResponseText) , aDLCI, aParams.iMaxFrameSize);
+	// We never expect to send a PN on the mux channel, however to aid interop 
+	// with shoddy remotes we tolerate responding to one
+	__ASSERT_DEBUG(((aDLCI != KMuxDLCI) || !aCommand), Panic(ERfCommUnexpectedCommandOnMuxChannel));
+	
+	// We always expect a response for a PN command frame, so this frame should
+	// be associated with a SAP.
+	__ASSERT_DEBUG(!aCommand || aSAP, Panic(ERfCommNothingToHandleResponse));
+
 	CRfcommMuxCtrlFrame* frm=NewSignalFrame(KRPNCommandLength, aCommand, aSAP);
 
 	if(!frm)
@@ -2801,6 +2830,13 @@
 	LOG3(_L("RFCOMM: SendMSC %S DLCI %d, Signals %x"),
 		(aCommand?&KCommandText:&KResponseText), aDLCI, aSignals);
 	
+	// We never expect an MSC on the mux channel
+	__ASSERT_DEBUG(aDLCI != KMuxDLCI, Panic(ERfCommUnexpectedCommandOnMuxChannel));
+	
+	// We always expect a response for an MSC command frame, so this frame should
+	// be associated with a SAP.
+	__ASSERT_DEBUG(!aCommand || aSAP, Panic(ERfCommNothingToHandleResponse));
+	
 	CRfcommMuxCtrlFrame* frm=NewSignalFrame(KMSCCommandLength, aCommand, aSAP);
 	if(!frm)
 		return KErrNoMemory;
@@ -2844,6 +2880,13 @@
 	   Send out a RLS signalling command
 	**/
 	{
+	// We never expect an RLS on the mux channel
+	__ASSERT_DEBUG(aDLCI != KMuxDLCI, Panic(ERfCommUnexpectedCommandOnMuxChannel));
+	
+	// We always expect a response for an RLS command frame, so this frame should
+	// be associated with a SAP.
+	__ASSERT_DEBUG(!aCommand || aSAP, Panic(ERfCommNothingToHandleResponse));
+	
 	CRfcommMuxCtrlFrame* frm=NewSignalFrame(KRLSCommandLength, aCommand, aSAP);
 	if(!frm)
 		return KErrNoMemory;
--- a/bluetooth/btstack/rfcomm/rfcommstates.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/rfcomm/rfcommstates.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -99,7 +99,6 @@
 
 	if(aType & MSocketNotify::EErrorFatal)
 		{
-		aSAP.iProtocol.ControlPlane().ModifyPhysicalLink(EUndoOverridePark, aSAP.iRemoteDev);
 		ChangeState(aSAP, CRfcommStateFactory::EError);
 		}
 	return aErr;
@@ -657,6 +656,16 @@
 	   don't want to get any more notifications from the mux
 	**/
 	{
+	// Depending where we came from we may have applied either a
+	// park override or an all LPM override.  We remove both these
+	// overrides because it's safe to remove an override that 
+	// hasn't been applied.
+	// Note that although park is one of the LPMs the different
+	// levels of override are managed separately, so an
+	// UndoOverrideLPM does not remove an explicit park only 
+	// override.
+	aSAP.iProtocol.ControlPlane().ModifyPhysicalLink(EUndoOverridePark, aSAP.iRemoteDev);
+	aSAP.iProtocol.ControlPlane().ModifyPhysicalLink(EUndoOverrideLPM, aSAP.iRemoteDev);
 
 	aSAP.DeregisterCodService();	// See if there is a Service to remove for CodMan
 	
@@ -694,13 +703,23 @@
 		}
 	aSAP.iNewDataToNotify=0;
 	aSAP.iDataBuffer.Reset();
+	
+	// Depending where we came from we may have applied either a
+	// park override or an all LPM override.  We remove both these
+	// overrides because it's safe to remove an override that 
+	// hasn't been applied.
+	// Note that although park is one of the LPMs the different
+	// levels of override are managed separately, so an
+	// UndoOverrideLPM does not remove an explicit park only 
+	// override.
 	aSAP.iProtocol.ControlPlane().ModifyPhysicalLink(EUndoOverridePark, aSAP.iRemoteDev);
+	aSAP.iProtocol.ControlPlane().ModifyPhysicalLink(EUndoOverrideLPM, aSAP.iRemoteDev);
+
 	if(aSAP.iMux)
 		{
 		aSAP.iMux->DetachSAP(aSAP);
 		}
 	aSAP.DeregisterCodService();	// See if there is a Service to remove for CodMan
-		
 	}
 
 void TRfcommStateClosed::Error(CRfcommSAP& /*aSAP*/, TInt /*aErr*/, 
@@ -731,7 +750,11 @@
 		}
 
 	aSAP.RegisterCodService();	// See if there is a Service set for CodMan
-		
+	
+	// Override LPM while we do some sigalling to ensure it can complete in 
+	// a timely fashion.
+	aSAP.iProtocol.ControlPlane().ModifyPhysicalLink(EOverrideLPM, aSAP.iRemoteDev);
+
 	// First get a Mux.
 	ChangeState(aSAP, CRfcommStateFactory::EWaitForMux);
 	}
@@ -1313,7 +1336,7 @@
 		newSAP->iRemoteDev=aMux.RemoteBTAddr();
 		//  Must come after registering the remote address with the new SAP because we will need 
 		//  the remote address  to find a link in LinkMgrProtocol to override LPM on
-		newSAP->iProtocol.ControlPlane().ModifyPhysicalLink(EOverrideLPMWithTimeout, newSAP->iRemoteDev);
+		newSAP->iProtocol.ControlPlane().ModifyPhysicalLink(EOverrideLPM, newSAP->iRemoteDev);
 		newSAP->iUserDefinedMTU=aSAP.iUserDefinedMTU;	//	We take our cues as
 														//	regards max MTU from
 														//	the listening SAP.
@@ -1738,7 +1761,17 @@
 		return;
 		}
 	
+	// Depending where we came from we may have applied either a
+	// park override or an all LPM override.  We remove both these
+	// overrides because it's safe to remove an override that 
+	// hasn't been applied.
+	// Note that although park is one of the LPMs the different
+	// levels of override are managed separately, so an
+	// UndoOverrideLPM does not remove an explicit park only 
+	// override.
 	aSAP.iProtocol.ControlPlane().ModifyPhysicalLink(EUndoOverridePark, aSAP.iRemoteDev);
+	aSAP.iProtocol.ControlPlane().ModifyPhysicalLink(EUndoOverrideLPM, aSAP.iRemoteDev);
+
 	aSAP.iSocket->ConnectComplete();
 	aSAP.CTS(EFalse);			//	So that we block should anyone try to write
 								//	anything through this SAP before we get MSC
@@ -1779,6 +1812,9 @@
 	   Shutdown the open channel gracefully
 	**/
 	{
+	// Only override park for disconnect.  We need to be able
+	// to send the signalling, but we don't care if it takes
+	// ages.  No point starting a sniff bun-fight.
 	aSAP.iProtocol.ControlPlane().ModifyPhysicalLink(EOverridePark, aSAP.iRemoteDev);
 	aSAP.iClosePending=ETrue;
 	ChangeState(aSAP, CRfcommStateFactory::EDisconnect);
@@ -1796,6 +1832,10 @@
 	//	the queued DISC frame does not get deleted when the SAP gets 
 	//	removed from the muxer
 	__ASSERT_DEBUG(aSAP.iMux!=NULL,PanicInState(ERfcommNullMux));
+	
+	// Only override park for disconnect.  We need to be able
+	// to send the signalling, but we don't care if it takes
+	// ages.  No point starting a sniff bun-fight.
 	aSAP.iProtocol.ControlPlane().ModifyPhysicalLink(EOverridePark, aSAP.iRemoteDev);
 	aSAP.iMux->SendDISC(aSAP.DLCI());  // Disassociated from the SAP
 	ChangeState(aSAP, CRfcommStateFactory::EClosed);
--- a/bluetooth/btstack/rfcomm/rfcommutil.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/rfcomm/rfcommutil.h	Thu Sep 23 17:06:47 2010 +0300
@@ -89,6 +89,9 @@
 	ERfCommMuxerStateOutOfBounds = 64, 
 	ERfCommStateOutOfBounds = 65,
 	ERfCommStateBufferFull = 66,
+	ERfCommNothingToHandleResponse = 67,
+	ERfCommDiscSentOnMuxDlci = 68,
+	ERfCommUnexpectedCommandOnMuxChannel = 69,
 	};
 
 /**
--- a/bluetooth/btstack/sdp/sdpclient.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/sdp/sdpclient.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -40,6 +40,7 @@
 	{
 	iBoundSAP=iL2CAP.NewSAPL(KSockSeqPacket);
 	iBoundSAP->SetNotify(this);
+	iBoundSAP->SecurityCheck(this);
 	CheckForIdle(KSDPIdleTimeout*4);// No point hanging about if no one connects
 	}
 
@@ -93,6 +94,13 @@
 		{
 		Panic(ESdpErrorSettingAddress);
 		}
+	TPckgBuf<TBool> noSecurityRequired;
+	noSecurityRequired() = ETrue;
+	
+	if(iBoundSAP->SetOption(KSolBtSAPBase, KBTSetNoSecurityRequired, noSecurityRequired)!=KErrNone)
+		{
+		Panic(ESdpAgentErrorSettingNoSecurity);
+		}
 	iBoundSAP->ActiveOpen();  // Signals ConnectComplete eventually!
 	}
 
@@ -650,3 +658,7 @@
 	return FALSE;
 	}
 
+TInt CSdpClient::CheckPolicy(const TSecurityPolicy& /*aPolicy*/, const char* /*aDiagnostic*/)
+	{
+	return KErrNone;
+	}
--- a/bluetooth/btstack/sdp/sdpclient.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/sdp/sdpclient.h	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -32,7 +32,7 @@
    acts as an internal socket binding to a lower level SAP.  Thus we
    derive from MSocketNotify so that the SAP can directly notify us of events.
 **/
-NONSHARABLE_CLASS(CSdpClient) : public CBase, private MSocketNotify
+NONSHARABLE_CLASS(CSdpClient) : public CBase, private MSocketNotify, private MProvdSecurityChecker
 	{
 friend class CSdpProtocol;
 public:
@@ -72,6 +72,9 @@
 	void Bearer(const TDesC8& /*aConnectionInf*/) {};
 
 private:
+	// From MProvdSecurityChecker
+	TInt CheckPolicy(const TSecurityPolicy& aPolicy, const char *aDiagnostic);
+	
 	// Create/destroy
 	CSdpClient(CSdpProtocol& aProtocol, CProtocolBase& aL2CAP); 
 	void ConstructL();
--- a/bluetooth/btstack/sdp/sdpstackutil.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/sdp/sdpstackutil.h	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2000-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"
@@ -31,7 +31,8 @@
 	ESdpTwoQuerys,						//  8
 	ESdpNoRequestPdu,					//  9
 	ESdpBadUUID,						// 10
-	ESdpAgentBadResultLength			// 11
+	ESdpAgentBadResultLength,			// 11
+	ESdpAgentErrorSettingNoSecurity,	// 12
 	};
 
 void Panic(TSdpPanic aPanic);
--- a/bluetooth/btstack/secman/btaccessrequester.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/secman/btaccessrequester.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -51,10 +51,11 @@
 											  const TBTServiceSecurityPerDevice* const aOverride,
 											  MAccessRequestResponseHandler& aRequester,
 											  TAccessType aAccessType,
+											  TBool aNoSecurityRequired,
 											  CBTSecMan& aParent)
 	{
 	LOG_STATIC_FUNC
-	CBTAccessRequester* s = new(ELeave) CBTAccessRequester(aConnection, aSecurityRequired, aOverride, aRequester, aAccessType, aParent);
+	CBTAccessRequester* s = new(ELeave) CBTAccessRequester(aConnection, aSecurityRequired, aOverride, aRequester, aAccessType, aNoSecurityRequired, aParent);
 	CleanupStack::PushL(s);
 	s->ConstructL();
 	return s;
@@ -66,6 +67,7 @@
 									   const TBTServiceSecurityPerDevice* const aOverride,
 									   MAccessRequestResponseHandler& aRequester,
 									   TAccessType aAccessType,
+									   TBool aNoSecurityRequired,
 									   CBTSecMan& aParent)
 	: iRequester(aRequester)
 	, iSecMan(aParent)
@@ -81,6 +83,7 @@
 	, iAccessType(aAccessType)
 	, iRemoteIndicatedNoBonding(EFalse)
 	, iCurrentState(EBTUninitialised)
+	, iNoSecurityRequired(aNoSecurityRequired)
 	{
 	LOG_FUNC
 	// try to get name for UI dialogs
@@ -911,7 +914,13 @@
 	// Here we determine if authentication is required on the link.
 	TBool authenticationRequired = EFalse;
 	
-	if(iBaseband->SimplePairingMode() == EPhySimplePairingEnabled)
+	if (iNoSecurityRequired)
+		{
+		// This is used for Security Mode 4 "no security required", e.g. SDP, 
+		// which we never authenticate
+		// <NOP> // authenticationRequired is already EFalse
+		}
+	else if(iBaseband->SimplePairingMode() == EPhySimplePairingEnabled)
 		{
 		// If operating in simple pairing mode then authentication is always required
 		// due to security mode 4.
@@ -948,7 +957,7 @@
 	{
 	LOG_FUNC
 	TBool authenticationRecommended = AuthenticationRequired();
-	if(!authenticationRecommended && LinkKeyGoodEnough())
+	if(!authenticationRecommended && LinkKeyGoodEnough() && !iNoSecurityRequired)
 		{
 		// If the current link key is good enough then we should be able to use that
 		// if it is available.
@@ -984,7 +993,7 @@
 		{
 		// Otherwise dedicated bonding is incidental...so only for general bonding accesses
 		// do we consider enabling encryption.
-		if(iBaseband->SimplePairingMode() == EPhySimplePairingEnabled)
+		if(iBaseband->SimplePairingMode() == EPhySimplePairingEnabled && !iNoSecurityRequired)
 			{
 			// If the link is SSP capable then for security mode 4 we must encrypt the link
 			// for general bonding requests.
--- a/bluetooth/btstack/secman/pairingserver.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/secman/pairingserver.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -639,7 +639,6 @@
 		}
 	}
 
-
 void COobDataSession::XoldoLocalOobDataRetrieved(TInt aResult, const TBluetoothSimplePairingHash& aHash, const TBluetoothSimplePairingRandomizer& aRandomizer)
 	{
 	LOG_FUNC
@@ -702,8 +701,8 @@
 	{
 	LOG_FUNC
 	iPhysicalLinksManager.SecMan().CancelRequest(*this);
-	delete iProxySap;
-	if(iStartBondingMsg.Handle())
+	delete iProxySap; // cannot do an immediate shutdown as the semantics for that kill the phy
+	if(!iStartBondingMsg.IsNull())
 		{
 		iStartBondingMsg.Complete(KErrCancel);
 		}
@@ -718,6 +717,7 @@
 	case EPairingServerStartDedicatedBond:
 		StartBondingL(aMessage);
 		break;
+		
 	default:
 		CPairingSubSession::DispatchSubSessMessageL(aMessage);
 		break;
@@ -727,9 +727,18 @@
 void CDedicatedBondingSession::Complete(TInt aError)
 	{
 	LOG_FUNC
-	iState = EShutdown;
-	iAsyncShutdown->CallBack();
-	iStartBondingMsg.Complete(aError);
+	if(!iStartBondingMsg.IsNull())
+		{
+		__ASSERT_DEBUG(!ShuttingDown(), PANIC(KPairingServerFaultCat, EPairingServerBadShutdownState));
+		iState = EShutdownRequested;
+		iAsyncShutdown->CallBack();
+		iPhysicalLinksManager.SecMan().CancelRequest(*this); // we don't want the result anymore (if it's still pending).
+		iStartBondingMsg.Complete(aError); 
+		}
+	else
+		{
+		__ASSERT_DEBUG(ShuttingDown(), PANIC(KPairingServerFaultCat, EPairingServerBadShutdownState));
+		}
 	}
 
 TInt CDedicatedBondingSession::StaticShutdown(TAny* aDedBond)
@@ -742,42 +751,49 @@
 void CDedicatedBondingSession::Shutdown()
 	{
 	LOG_FUNC
-	__ASSERT_DEBUG(iState == EShutdown, PANIC(KPairingServerFaultCat, EPairingServerBadShutdownState));
-	iState = EInvalid;
+	__ASSERT_DEBUG(iState == EShutdownRequested, PANIC(KPairingServerFaultCat, EPairingServerBadShutdownState));
+	__ASSERT_DEBUG(iStartBondingMsg.IsNull(), PANIC(KPairingServerFaultCat, EPairingServerMessageShouldBeNull));
+	iState = EShutdownPending;
 	iProxySap->Shutdown(CServProviderBase::ENormal);
 	}
+	
+TBool CDedicatedBondingSession::ShuttingDown() const
+	{
+	return iState == EShutdownRequested || iState == EShutdownPending;
+	}
 
 void CDedicatedBondingSession::StartBondingL(const RMessage2& aMessage)
 	{
 	LOG_FUNC
 
-	if(!iStartBondingMsg.IsNull() || iState != EInvalid)
+	if(iState != EMintCondition)
 		{
 		aMessage.Panic(KPairingServerPanicCat, EPairingServerDedicatedBondAlreadyInProgress);
 		return;
 		}
-
+	__ASSERT_DEBUG(iStartBondingMsg.IsNull(), PANIC(KPairingServerFaultCat, EPairingServerMessageShouldBeNull));
+	
+	// Now we've been initiated, no turning back for this object.
+	iState = EInitiated;
+	
 	TPckgBuf<TBTDevAddr> addrBuf;
 	TInt addrLen = aMessage.GetDesLengthL(0);
 	if(addrLen != sizeof(TBTDevAddr))
 		{
-		// If the length is correct then the address has been packaged incorrect for the
+		// If the length is incorrect then the address has been packaged incorrectly for the
 		// IPC operation.
 		LEAVEL(KErrBadDescriptor);
 		}
 	aMessage.ReadL(0, addrBuf);
 
-	iStartBondingMsg = aMessage;
-	CleanupStack::PushL(TCleanupItem(CleanupStartMessage, this));
-
 	TBTSockAddr addr;
 	addr.SetBTAddr(addrBuf());
 	iProxySap = CBTProxySAP::NewL(iPhysicalLinksManager, NULL);
-
-	CleanupStack::Pop(this); // the start message cleaner
 	
+	iStartBondingMsg = aMessage;
 	// Now we've entered the realm of not leaving with an error, since the connection
 	// process has started.  Errors from now on must be via the Error() function call.
+	
 	iState = EInitialConnectionPending;
 	iProxySap->SetNotify(this);
 	iProxySap->SetRemName(addr);
@@ -789,13 +805,6 @@
 		}
 	}
 
-void CDedicatedBondingSession::CleanupStartMessage(TAny* aPtr)
-	{
-	LOG_STATIC_FUNC
-	CDedicatedBondingSession* session = reinterpret_cast<CDedicatedBondingSession*>(aPtr);
-	session->iStartBondingMsg = RMessage2(); // blat the old one
-	}
-
 void CDedicatedBondingSession::DoAccessRequestL()
 	{
 	LOG_FUNC
@@ -803,7 +812,7 @@
 	security.SetAuthentication(EMitmDesired);
 	security.SetUid(KBluetoothDedicatedBondingUid);
 
-	iPhysicalLinksManager.SecMan().AccessRequestL(security, NULL, iProxySap->RemoteAddress(), EDedicatedBonding, *this);
+	iPhysicalLinksManager.SecMan().AccessRequestL(security, NULL, iProxySap->RemoteAddress(), EDedicatedBonding, EFalse, *this);
 	}
 
 void CDedicatedBondingSession::AccessRequestComplete(TInt aResult)
@@ -833,7 +842,7 @@
 		// fall-through...
 	case EInitialConnection:
 		ASSERT_DEBUG(aResult != EBTSecManAccessDeferred); // Should have been disconnected if we receive
-													// this - I don't expect this to happen.
+														  // this - I don't expect this to happen.
 		// fall-through...
 	case EFinalConnection:
 		completed = ETrue; // in the final connection any complete is errored.
@@ -842,12 +851,15 @@
 			err = KErrAccessDenied;
 			}
 		break;
+		
 	case EInitialConnectionPending:
+		// fall-through deliberate
 	case EFinalConnectionPending:
 		// Access request shouldn't successfully complete if the connection is still pending
 		__ASSERT_DEBUG(aResult != EBTSecManAccessGranted,  PANIC(KPairingServerFaultCat, EPairingServerUnexpectedAccessCallback));
 		// We should get the MSocketNotify::Error callback, so don't do anything else
 		break;
+		
 	default:
 		LOG1(_L("Unexpected Access Request Complete in state %d"), iState);
 		__ASSERT_DEBUG(EFalse, PANIC(KPairingServerFaultCat, EPairingServerUnexpectedAccessCallback));
@@ -885,15 +897,21 @@
 	case EFinalConnectionPending:
 		iState = EFinalConnection;
 		break;
+		
 	case EInitialConnection:
+		// fall-through deliberate
 	case EFinalConnection:
 		// Apparently multiple connect completes are allowed by CSocket
 		break;
-	case EShutdown:
+		
+	case EShutdownRequested:
+		// fall-through deliberate
+	case EShutdownPending:
 		// If an error occurred just after the connection request then we
 		// might receive a connection complete before the async shutdown request
-		// has been executed.
+		// has been executed or completed.
 		break;
+		
 	default:
 		LOG1(_L("Unexpected Connect Complete in state %d"), iState);
 		__ASSERT_DEBUG(EFalse, PANIC(KPairingServerFaultCat, EPairingServerUnexpectedSocketCallback));
@@ -924,6 +942,9 @@
 void CDedicatedBondingSession::CanClose(TDelete aDelete)
 	{
 	LOG_FUNC
+	__ASSERT_DEBUG(iState == EShutdownPending, PANIC(KPairingServerFaultCat, EPairingServerUnexpectedSocketCallback));
+	__ASSERT_DEBUG(iStartBondingMsg.IsNull(), PANIC(KPairingServerFaultCat, EPairingServerMessageShouldBeNull));
+	iState = EShutdown;
 	if (aDelete == EDelete)
 		{
 		delete iProxySap; iProxySap = NULL;
@@ -951,12 +972,17 @@
 		// enter the zombie state and wait for the access requester to complete.
 		iState = EZombie;
 		break;
+		
 	case EFinalConnection:
 		Error(KErrDisconnected);
 		break;
-	case EShutdown:
+		
+	case EShutdownRequested:
+		// fall-through deliberate
+	case EShutdownPending:
 		// Already closing down.
 		break;
+		
 	default:
 		LOG1(_L("Unexpected Disconnect in state %d"), iState);
 		__ASSERT_DEBUG(EFalse, PANIC(KPairingServerFaultCat, EPairingServerUnexpectedSocketCallback));
--- a/bluetooth/btstack/secman/pairingserver.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/secman/pairingserver.h	Thu Sep 23 17:06:47 2010 +0300
@@ -218,8 +218,8 @@
 
 	void Complete(TInt aError);
 
-	static void CleanupStartMessage(TAny* aPtr);
 	static TInt StaticShutdown(TAny* aPtr);
+	TBool ShuttingDown() const;
 
 private: // from CPairingSubSession
 	void DispatchSubSessMessageL(const RMessage2& aMessage);
@@ -246,12 +246,15 @@
 private:
 	enum TState
 		{
-		EInvalid,
+		EMintCondition,
+		EInitiated,
 		EInitialConnectionPending,
 		EInitialConnection,
 		EZombie,
 		EFinalConnectionPending,
 		EFinalConnection,
+		EShutdownRequested,
+		EShutdownPending,
 		EShutdown,
 		};
 
--- a/bluetooth/btstack/secman/public/pairingservershared.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/secman/public/pairingservershared.h	Thu Sep 23 17:06:47 2010 +0300
@@ -71,6 +71,7 @@
 	EPairingServerUnexpectedSocketCallback,
 	EPairingServerUnexpectedAccessCallback,
 	EPairingServerBadShutdownState,
+	EPairingServerMessageShouldBeNull,
 	};
 
 #endif // PAIRINGSERVERSHARED_H
--- a/bluetooth/btstack/secman/secman.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/secman/secman.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -266,6 +266,7 @@
 							   const TBTServiceSecurityPerDevice* const aOverride,
 							   const TBTDevAddr& aBDAddr,
 							   TAccessType aAccessType,
+							   TBool aNoSecurityRequired,
 							   MAccessRequestResponseHandler& aRequester)
 /**
 Handle an access request...
@@ -288,6 +289,7 @@
 													  aOverride,
 													  aRequester,
 													  aAccessType,
+													  aNoSecurityRequired,
 													  *this);
 	
 	CBTAccessRequester* requester = FindActiveAccessRequester(aBDAddr);
--- a/bluetooth/btstack/secman/secman.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/secman/secman.h	Thu Sep 23 17:06:47 2010 +0300
@@ -244,6 +244,7 @@
 						const TBTServiceSecurityPerDevice* const aOverride,
 						const TBTDevAddr& aBDAddr,
 						TAccessType aAccessType,
+						TBool aNoSecurityRequired,
 						MAccessRequestResponseHandler& aRequester);
 
 	void AccessRequestComplete(CBTAccessRequester* aRequester, TInt aResult);
@@ -328,6 +329,7 @@
 									 const TBTServiceSecurityPerDevice* const aOverride,
 									 MAccessRequestResponseHandler& aRequester,
 									 TAccessType aAccessType,
+									 TBool aNoSecurityRequired,
 									 CBTSecMan& aParent);
 	~CBTAccessRequester();
 
@@ -394,6 +396,7 @@
 					   const TBTServiceSecurityPerDevice* const aOverride,
 					   MAccessRequestResponseHandler& aRequester,
 					   TAccessType aDedicatedBonding,
+					   TBool aNoSecurityRequired,
 					   CBTSecMan& aParent);
 	void ConstructL();
 	void SubscribeToLinkObserver();
@@ -451,6 +454,8 @@
 	CAuthenticationTimer*			iTimer;
 	
 	TBTAccessRequesterState 		iCurrentState;
+	
+	TBool							iNoSecurityRequired; //< Security mode 4 "no security required" - do not do any authentiction, not even just works
 	};
 
 
--- a/bluetooth/btstack/test/util/hcemulator/hcemulator.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/test/util/hcemulator/hcemulator.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -21,7 +21,9 @@
 #include <f32file.h>
 #include <e32test.h>
 #include <c32comm.h>
-//#include <log.h>
+#include <bluetooth/hci/hciopcodes.h>
+#include <bluetooth/hci/hciconsts.h>
+#include <bluetooth/hci/aclpacketconsts.h>
 
 #include "hcemulator.h"
 
--- a/bluetooth/btstack/test/util/hcemulator/hcemulator.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/btstack/test/util/hcemulator/hcemulator.h	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -23,6 +23,7 @@
 #include <bt_sock.h>
 #include <c32comm.h>
 #include <bluetooth/hci/hcierrors.h>
+#include <bluetooth/hci/hcitypes.h>
 
 const TInt KReadBufSize			=258;
 const TInt KWriteBufSize		=258;
--- a/bluetooth/gavdp/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetooth/gavdp/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -16,7 +16,7 @@
 
 
 PRJ_EXPORTS
-../public/gavdp.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(gavdp.h)
+../public/gavdp.h OS_LAYER_PLATFORM_EXPORT_PATH(gavdp.h)
 
 PRJ_MMPFILES
 gavdp.mmp
--- a/bluetoothcommsprofiles/btpan/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetoothcommsprofiles/btpan/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-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"
@@ -26,19 +26,19 @@
 
 PRJ_EXPORTS
 
-../inc/panprog.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(panprog.h)
-../inc/panctrl.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(panctrl.h)
-../inc/panerr.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(panerr.h)
-../inc/BnepPacketNotifier.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/pan/bneppacketnotifier.h)
-../inc/panuiinterfaces.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(networking/panuiinterfaces.h)
-../inc/panroles.h 	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(networking/panroles.h)
-../group/btpan.iby  	/epoc32/rom/include/btpan.iby
+../inc/panprog.h OS_LAYER_PLATFORM_EXPORT_PATH(panprog.h)
+../inc/panctrl.h OS_LAYER_PLATFORM_EXPORT_PATH(panctrl.h)
+../inc/panerr.h OS_LAYER_PUBLIC_EXPORT_PATH(panerr.h)
+../inc/BnepPacketNotifier.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/pan/bneppacketnotifier.h)
+../inc/panuiinterfaces.h OS_LAYER_PLATFORM_EXPORT_PATH(networking/panuiinterfaces.h)
+../inc/panroles.h OS_LAYER_PLATFORM_EXPORT_PATH(networking/panroles.h)
+../group/btpan.iby /epoc32/rom/include/btpan.iby
 
 PRJ_MMPFILES
 
-../group/bnep.mmp
-../group/panagt.mmp
-../group/panhelper.mmp
+bnep.mmp
+panagt.mmp
+panhelper.mmp
 
 // PAN NAP IP Hook
 #include "../pannapiphook/group/bld.inf"
--- a/bluetoothcommsprofiles/btpan/group/bnep.mmp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetoothcommsprofiles/btpan/group/bnep.mmp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-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"
@@ -11,7 +11,7 @@
 // Contributors:
 //
 // Description:
-// MACRO __INSTRUMENT_FUNCTION_ENTRY_EXIT
+// BNEP protocol implementation project file
 // 
 //
 
@@ -52,7 +52,6 @@
 USERINCLUDE ../inc
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-USERINCLUDE   	/epoc32/include/networking	// This is a temporary fix pending the full solution of DEF50710
 
 LIBRARY			euser.lib
 LIBRARY			mbufmgr.lib
--- a/bluetoothmgmt/bluetoothclientlib/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetoothmgmt/bluetoothclientlib/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -16,40 +16,36 @@
 
 PRJ_EXPORTS
 //
-inc/bttypes.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(bttypes.h)
-inc/bt_sock.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(bt_sock.h)
-inc/btsocketoptionlevels.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(btsocketoptionlevels.h)
-inc/btsockaddr.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(btsockaddr.h)
-inc/btsecurity.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(btsecurity.h)
-inc/btbasebandpolicy.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(btbasebandpolicy.h)
-inc/btsyncbandwidth.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(btsyncbandwidth.h)
-inc/bt_subscribe_sec.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(bt_subscribe.h)
-inc/bt_subscribe_keybase.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(bt_subscribe_keybase.h)
-inc/btbaseband.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/btbaseband.h)
-inc/btscoparams.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/btscoparams.h)
-inc/lmoptions.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/lmoptions.h)
+inc/bttypes.h OS_LAYER_PUBLIC_EXPORT_PATH(bttypes.h)
+inc/bt_sock.h OS_LAYER_PUBLIC_EXPORT_PATH(bt_sock.h)
+inc/btsocketoptionlevels.h OS_LAYER_PUBLIC_EXPORT_PATH(btsocketoptionlevels.h)
+inc/btsockaddr.h OS_LAYER_PUBLIC_EXPORT_PATH(btsockaddr.h)
+inc/btsecurity.h OS_LAYER_PUBLIC_EXPORT_PATH(btsecurity.h)
+inc/btbasebandpolicy.h OS_LAYER_PUBLIC_EXPORT_PATH(btbasebandpolicy.h)
+inc/btsyncbandwidth.h OS_LAYER_PUBLIC_EXPORT_PATH(btsyncbandwidth.h)
+inc/bt_subscribe_sec.h OS_LAYER_PUBLIC_EXPORT_PATH(bt_subscribe.h)
+inc/bt_subscribe_keybase.h OS_LAYER_PUBLIC_EXPORT_PATH(bt_subscribe_keybase.h)
+inc/btbaseband.h OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/btbaseband.h)
+inc/btscoparams.h OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/btscoparams.h)
+inc/lmoptions.h OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/lmoptions.h)
 
-inc/bttypespartner.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bttypespartner.h)
-inc/bthci.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bthci.h)
-inc/bluetoothAV.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetoothav.h)
-inc/avctptypes.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/avctptypes.h)
-inc/avctpservices.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(avctpservices.h)
-inc/bt_subscribe_partner.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bt_subscribe_partner.h)
-inc/pairing.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/pairing.h)
-inc/eirpublisherbase.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/eirpublisherbase.h)
-inc/eirpublishermanufacturerspecificdata.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/eirpublishermanufacturerspecificdata.h)
-inc/aclsockaddr.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/aclsockaddr.h)
+inc/bttypespartner.h OS_LAYER_PLATFORM_EXPORT_PATH(bttypespartner.h)
+inc/bthci.h OS_LAYER_PLATFORM_EXPORT_PATH(bthci.h)
+inc/bluetoothAV.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetoothav.h)
+inc/avctptypes.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/avctptypes.h)
+inc/avctpservices.h OS_LAYER_PLATFORM_EXPORT_PATH(avctpservices.h)
+inc/bt_subscribe_partner.h OS_LAYER_PLATFORM_EXPORT_PATH(bt_subscribe_partner.h)
+inc/pairing.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/pairing.h)
+inc/eirpublisherbase.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/eirpublisherbase.h)
+inc/eirpublishermanufacturerspecificdata.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/eirpublishermanufacturerspecificdata.h)
+inc/aclsockaddr.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/aclsockaddr.h)
+inc/a2dpoptimisation.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/a2dpoptimisation.h)
+inc/a2dpoptimisationparams.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/a2dpoptimisationparams.h)
 
 
-
-inc/a2dpoptimisation.h						/epoc32/include/bluetooth/a2dpoptimisation.h
-inc/a2dpoptimisationparams.h				/epoc32/include/bluetooth/a2dpoptimisationparams.h
 PRJ_MMPFILES
 //
 btlib/bluetooth.mmp
 avlib/bluetoothAV.mmp
 avctpservices/avctpservices.mmp
 a2dpoptimisation/a2dpoptimisation.mmp
-
-PRJ_TESTMMPFILES
-//
--- a/bluetoothmgmt/bluetoothclientlib/inc/a2dpoptimisation.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetoothmgmt/bluetoothclientlib/inc/a2dpoptimisation.h	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -22,7 +22,7 @@
 #define A2DP_OPTIMISATION_H
 
 #include <e32base.h>
-#include <bluetooth/hci/hcitypes.h>
+#include <bttypes.h>
 
 class RHCIServerSession;
 
--- a/bluetoothmgmt/bluetoothclientlib/inc/bt_sock.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetoothmgmt/bluetoothclientlib/inc/bt_sock.h	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-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"
@@ -36,7 +36,7 @@
 
 #include <es_sock.h>
 #include <bttypes.h>
-#include <d32comm.h>	// for RS232 signal names for RFCOMM
+#include <d32public.h> // for RFCOMM API
 #include <bluetooth/hci/hcierrors.h>
 #include <btmanclient.h>
 #include <bt_subscribe.h>
@@ -102,9 +102,9 @@
 /** BT options. */
 enum TBTOptions
 	{
-	/** Override device security */
-	KBTRegisterCodService = 0x998,		/*!< Set a CoD Service bit(s) */
-	KBTSecurityDeviceOverride = 0x999,
+	KBTSetNoSecurityRequired = 0x997,	/*!< Set No security required for Security Mode 4*/
+    KBTRegisterCodService = 0x998,		/*!< Set a CoD Service bit(s) */
+	KBTSecurityDeviceOverride = 0x999,	/*!< Override device security */
 	};
 
 typedef TPckgBuf<TBTServiceSecurityPerDevice> TBTServiceSecurityPerDeviceBuf;	/*!< Package definition for securty settings */
--- a/bluetoothmgmt/btcommon/inc/BTSec.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetoothmgmt/btcommon/inc/BTSec.h	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-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"
@@ -26,6 +26,7 @@
 #include <e32std.h>
 
 const TUint32 KBTManServerSID = 0x100069cc;
+const TUint32 KSdpServerSID = 0x10009220;
 
 _LIT_SECURITY_POLICY_C1(KLOCAL_SERVICES,ECapabilityLocalServices);
 _LIT_SECURITY_POLICY_S1(KBTMAN_SID_PROT_SERV,KBTManServerSID,ECapabilityProtServ);
@@ -33,6 +34,7 @@
 _LIT_SECURITY_POLICY_C1(KNETWORK_CONTROL, ECapabilityNetworkControl);
 _LIT_SECURITY_POLICY_C2(KLOCAL_SERVICES_AND_READ_DEVICE_DATA,ECapabilityLocalServices,ECapabilityReadDeviceData);
 _LIT_SECURITY_POLICY_C2(KLOCAL_SERVICES_AND_WRITE_DEVICE_DATA,ECapabilityLocalServices,ECapabilityWriteDeviceData);
+_LIT_SECURITY_POLICY_S1(KSDP_SID_PROT_SERV, KSdpServerSID,ECapabilityProtServ);
 
 _LIT_SECURITY_POLICY_C1(KCOMMDD,ECapabilityCommDD);
 
--- a/bluetoothmgmt/btmgr/Inc/btdevice.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetoothmgmt/btmgr/Inc/btdevice.h	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-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"
@@ -20,14 +20,13 @@
 #include <e32base.h>
 #include <s32mem.h>
 
-#include <bluetooth/hci/hciopcodes.h>
-#include <bluetooth/hci/hciconsts.h>
+#include <bttypes.h>
 
 /** The maximum length of a bluetooth device name, as stored in CBTDevice.
 @publishedAll
 @released
 **/
-static const TInt KMaxBluetoothNameLen = KHCILocalDeviceNameMaxLength;
+static const TInt KMaxBluetoothNameLen = 248;
 
 /** The maximum length of the user-assinged friendly name for a bluetooth device, as stored in CBTDevice.
 @publishedAll
--- a/bluetoothmgmt/btmgr/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetoothmgmt/btmgr/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -16,9 +16,9 @@
 //
 
 PRJ_EXPORTS
-Inc/BTDefCommPort.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(btdefcommport.h)
-Inc/btdevice.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(btdevice.h)
-Inc/btmanclient.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(btmanclient.h)
+Inc/BTDefCommPort.h OS_LAYER_PUBLIC_EXPORT_PATH(btdefcommport.h)
+Inc/btdevice.h OS_LAYER_PUBLIC_EXPORT_PATH(btdevice.h)
+Inc/btmanclient.h OS_LAYER_PUBLIC_EXPORT_PATH(btmanclient.h)
 
 //	Export the compiled DBMS policy file for the Bluetooth Manager DB...
 BTManServer/100069CC.SPD z:/private/100012a5/policy/100069cc.spd
--- a/bluetoothmgmt/btmgr/eirclient/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetoothmgmt/btmgr/eirclient/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-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"
@@ -14,9 +14,9 @@
 //
 
 PRJ_EXPORTS
-../interface/eirclient.h      SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/eirclient.h)
-../interface/eirpublisher.h      SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/eirpublisher.h)
-../interface/eirdatacodec.h      SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/eirdatacodec.h)
+../interface/eirclient.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/eirclient.h)
+../interface/eirpublisher.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/eirpublisher.h)
+../interface/eirdatacodec.h	OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/eirdatacodec.h)
 
 PRJ_MMPFILES
 eirclient.mmp
--- a/bluetoothmgmt/btrom/bluetooth.iby	Wed Jul 21 15:42:05 2010 +0300
+++ b/bluetoothmgmt/btrom/bluetooth.iby	Thu Sep 23 17:06:47 2010 +0300
@@ -58,7 +58,7 @@
 file=ABI_DIR\BT_DIR\sdpagent.dll		System\Libs\sdpagent.dll
 
 REM Bluetooth AV user libraries
-file=ABI_DIR\BT_DIR\bluetoothAV.dll		System\Libs\bluetoothAV.dll
+file=ABI_DIR\BT_DIR\bluetoothav.dll		System\Libs\bluetoothAV.dll
 file=ABI_DIR\BT_DIR\gavdp.dll			System\Libs\gavdp.dll
 
 REM Generic Remote Control Framework
@@ -88,7 +88,7 @@
 data=ZPRIVATE\100069cc\backup_registration.xml	Private\100069cc\backup_registration.xml
 
 REM default is to run Esock_BT thread in DealerPlayer role
-data=ZPRIVATE\101F7988\esock_bt.cmi private\101F7988\esock_bt.cmi
+data=ZPRIVATE\101f7988\esock_bt.cmi private\101F7988\esock_bt.cmi
 
 file=ABI_DIR\BT_DIR\btcomm.csy			System\Libs\btcomm.csy
 
@@ -102,8 +102,8 @@
 REM Bluetooth using HCI API Version 2
 file=ABI_DIR\BT_DIR\bt_v2.prt							System\Libs\bt_v2.prt
 REM Stack configuration files
-data=ZPRIVATE\101f7989\ESock\bt.bt_v2.esk				Private\101f7989\ESock\bt.bt_v2.esk
-data=ZPRIVATE\101F7989\Bluetooth\bluetooth_stack.ini	Private\101F7989\Bluetooth\bluetooth_stack.ini
+data=ZPRIVATE\101f7989\esock\bt.bt_v2.esk				Private\101f7989\ESock\bt.bt_v2.esk
+data=ZPRIVATE\101f7989\bluetooth\bluetooth_stack.ini	Private\101F7989\Bluetooth\bluetooth_stack.ini
 
 REM HCI Shared binary
 file=ABI_DIR\BT_DIR\hcishared.dll			System\Libs\hcishared.dll
--- a/bthci/bthci2/CommandsEvents/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/CommandsEvents/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-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"
@@ -16,13 +16,13 @@
 PRJ_EXPORTS
 // Base classes and utilities for commands and events.
 
-../interface/Command.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/command.h)
-../interface/Event.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/event.h)
-../interface/commandcompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/commandcompleteevent.h)
-../interface/VendorDebugCommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/vendordebugcommand.h)
-../interface/VendorDebugEvent.H				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/vendordebugevent.h)
-../interface/VendorDebugCompleteEvent.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/vendordebugcompleteevent.h)
-../interface/completingeventquery.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/completingeventquery.h)
+../interface/Command.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/command.h)
+../interface/Event.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/event.h)
+../interface/commandcompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/commandcompleteevent.h)
+../interface/VendorDebugCommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/vendordebugcommand.h)
+../interface/VendorDebugEvent.H				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/vendordebugevent.h)
+../interface/VendorDebugCompleteEvent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/vendordebugcompleteevent.h)
+../interface/completingeventquery.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/completingeventquery.h)
 
 // The actual commands and events classes.
 
@@ -31,347 +31,347 @@
 //
 // Link Control Commands
 //
-../interface/inquirycommand.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquirycommand.h)
-../interface/inquirycancelcommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquirycancelcommand.h)
-../interface/periodicinquirymodecommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/periodicinquirymodecommand.h)
-../interface/exitperiodicinquirymodecommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/exitperiodicinquirymodecommand.h)
-../interface/createaclconnectioncommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/createaclconnectioncommand.h)
-../interface/disconnectcommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/disconnectcommand.h)
-../interface/createconnectioncancelcommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/createconnectioncancelcommand.h)
-../interface/acceptconnectionrequestcommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/acceptconnectionrequestcommand.h)
-../interface/rejectconnectionrequestcommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/rejectconnectionrequestcommand.h)
-../interface/linkkeyrequestreplycommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeyrequestreplycommand.h)
-../interface/linkkeyrequestreplynegativecommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeyrequestreplynegativecommand.h)
-../interface/pincoderequestreplycommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pincoderequestreplycommand.h)
-../interface/pincoderequestreplynegativecommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pincoderequestreplynegativecommand.h)
-../interface/changeconnectionpackettypecommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/changeconnectionpackettypecommand.h)
-../interface/authenticationrequestedcommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/authenticationrequestedcommand.h)
-../interface/setconnectionencryptioncommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setconnectionencryptioncommand.h)
-../interface/changelinkkeycommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/changelinkkeycommand.h)
-../interface/masterlinkkeycommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/masterlinkkeycommand.h)
-../interface/remotenamerequestcommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remotenamerequestcommand.h)
-../interface/remotenamerequestcancelcommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remotenamerequestcancelcommand.h)
-../interface/readremotesupportedfeaturescommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremotesupportedfeaturescommand.h)
-../interface/readremoteextendedfeaturescommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremoteextendedfeaturescommand.h)
-../interface/readremoteversioninfocommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremoteversioninfocommand.h)
-../interface/readclockoffsetcommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclockoffsetcommand.h)
-../interface/readlmphandlecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlmphandlecommand.h)
-../interface/setupsynchronousconnectioncommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setupsynchronousconnectioncommand.h)
-../interface/acceptsynchronousconnectionrequestcommand.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/acceptsynchronousconnectionrequestcommand.h)
-../interface/rejectsynchronousconnectionrequestcommand.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/rejectsynchronousconnectionrequestcommand.h)
-../interface/iocapabilityrequestreplycommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityrequestreplycommand.h)
-../interface/userconfirmationrequestreplycommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userconfirmationrequestreplycommand.h)
-../interface/userconfirmationrequestnegativereplycommand.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userconfirmationrequestnegativereplycommand.h)
-../interface/userpasskeyrequestreplycommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeyrequestreplycommand.h)
-../interface/userpasskeyrequestnegativereplycommand.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeyrequestnegativereplycommand.h)
-../interface/remoteoobdatarequestreplycommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remoteoobdatarequestreplycommand.h)
-../interface/remoteoobdatarequestnegativereplycommand.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remoteoobdatarequestnegativereplycommand.h)
-../interface/iocapabilityrequestnegativereplycommand.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityrequestnegativereplycommand.h)
+../interface/inquirycommand.h								OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquirycommand.h)
+../interface/inquirycancelcommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquirycancelcommand.h)
+../interface/periodicinquirymodecommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/periodicinquirymodecommand.h)
+../interface/exitperiodicinquirymodecommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/exitperiodicinquirymodecommand.h)
+../interface/createaclconnectioncommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/createaclconnectioncommand.h)
+../interface/disconnectcommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/disconnectcommand.h)
+../interface/createconnectioncancelcommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/createconnectioncancelcommand.h)
+../interface/acceptconnectionrequestcommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/acceptconnectionrequestcommand.h)
+../interface/rejectconnectionrequestcommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/rejectconnectionrequestcommand.h)
+../interface/linkkeyrequestreplycommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeyrequestreplycommand.h)
+../interface/linkkeyrequestreplynegativecommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeyrequestreplynegativecommand.h)
+../interface/pincoderequestreplycommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pincoderequestreplycommand.h)
+../interface/pincoderequestreplynegativecommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pincoderequestreplynegativecommand.h)
+../interface/changeconnectionpackettypecommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/changeconnectionpackettypecommand.h)
+../interface/authenticationrequestedcommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/authenticationrequestedcommand.h)
+../interface/setconnectionencryptioncommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setconnectionencryptioncommand.h)
+../interface/changelinkkeycommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/changelinkkeycommand.h)
+../interface/masterlinkkeycommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/masterlinkkeycommand.h)
+../interface/remotenamerequestcommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remotenamerequestcommand.h)
+../interface/remotenamerequestcancelcommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remotenamerequestcancelcommand.h)
+../interface/readremotesupportedfeaturescommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremotesupportedfeaturescommand.h)
+../interface/readremoteextendedfeaturescommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremoteextendedfeaturescommand.h)
+../interface/readremoteversioninfocommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremoteversioninfocommand.h)
+../interface/readclockoffsetcommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclockoffsetcommand.h)
+../interface/readlmphandlecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlmphandlecommand.h)
+../interface/setupsynchronousconnectioncommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setupsynchronousconnectioncommand.h)
+../interface/acceptsynchronousconnectionrequestcommand.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/acceptsynchronousconnectionrequestcommand.h)
+../interface/rejectsynchronousconnectionrequestcommand.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/rejectsynchronousconnectionrequestcommand.h)
+../interface/iocapabilityrequestreplycommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityrequestreplycommand.h)
+../interface/userconfirmationrequestreplycommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userconfirmationrequestreplycommand.h)
+../interface/userconfirmationrequestnegativereplycommand.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userconfirmationrequestnegativereplycommand.h)
+../interface/userpasskeyrequestreplycommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeyrequestreplycommand.h)
+../interface/userpasskeyrequestnegativereplycommand.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeyrequestnegativereplycommand.h)
+../interface/remoteoobdatarequestreplycommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remoteoobdatarequestreplycommand.h)
+../interface/remoteoobdatarequestnegativereplycommand.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remoteoobdatarequestnegativereplycommand.h)
+../interface/iocapabilityrequestnegativereplycommand.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityrequestnegativereplycommand.h)
 //
 // Link Policy Commands
 //
-../interface/holdmodecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/holdmodecommand.h)
-../interface/sniffmodecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sniffmodecommand.h)
-../interface/exitsniffmodecommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/exitsniffmodecommand.h)
-../interface/parkmodecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/parkmodecommand.h)
-../interface/exitparkmodecommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/exitparkmodecommand.h)
-../interface/qossetupcommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/qossetupcommand.h)
-../interface/rolediscoverycommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/rolediscoverycommand.h)
-../interface/switchrolecommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/switchrolecommand.h)
-../interface/readlinkpolicysettingscommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinkpolicysettingscommand.h)
-../interface/writelinkpolicysettingscommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelinkpolicysettingscommand.h)
-../interface/readdefaultlinkpolicysettingscommand.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readdefaultlinkpolicysettingscommand.h)
-../interface/writedefaultlinkpolicysettingscommand.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writedefaultlinkpolicysettingscommand.h)
-../interface/flowspecificationcommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/flowspecificationcommand.h)
-../interface/sniffsubratingcommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sniffsubratingcommand.h)
+../interface/holdmodecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/holdmodecommand.h)
+../interface/sniffmodecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sniffmodecommand.h)
+../interface/exitsniffmodecommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/exitsniffmodecommand.h)
+../interface/parkmodecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/parkmodecommand.h)
+../interface/exitparkmodecommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/exitparkmodecommand.h)
+../interface/qossetupcommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/qossetupcommand.h)
+../interface/rolediscoverycommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/rolediscoverycommand.h)
+../interface/switchrolecommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/switchrolecommand.h)
+../interface/readlinkpolicysettingscommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinkpolicysettingscommand.h)
+../interface/writelinkpolicysettingscommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelinkpolicysettingscommand.h)
+../interface/readdefaultlinkpolicysettingscommand.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readdefaultlinkpolicysettingscommand.h)
+../interface/writedefaultlinkpolicysettingscommand.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writedefaultlinkpolicysettingscommand.h)
+../interface/flowspecificationcommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/flowspecificationcommand.h)
+../interface/sniffsubratingcommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sniffsubratingcommand.h)
 //
 // Controller and Baseband Commands
 //
-../interface/seteventmaskcommand.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/seteventmaskcommand.h)
-../interface/resetcommand.h										SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/resetcommand.h)
-../interface/seteventfiltercommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/seteventfiltercommand.h)
-../interface/flushcommand.h										SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/flushcommand.h)
-../interface/readpintypecommand.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpintypecommand.h)
-../interface/writepintypecommand.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepintypecommand.h)
-../interface/createnewunitkeycommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/createnewunitkeycommand.h)
-../interface/readstoredlinkkeycommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readstoredlinkkeycommand.h)
-../interface/writestoredlinkkeycommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writestoredlinkkeycommand.h)
-../interface/deletestoredlinkkeycommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/deletestoredlinkkeycommand.h)
-../interface/WriteLocalNameCommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelocalnamecommand.h)
-../interface/ReadLocalNameCommand.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalnamecommand.h)
-../interface/readconnectionaccepttimeoutcommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readconnectionaccepttimeoutcommand.h)
-../interface/writeconnectionaccepttimeoutcommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeconnectionaccepttimeoutcommand.h)
-../interface/readpagetimeoutcommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagetimeoutcommand.h)
-../interface/writepagetimeoutcommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagetimeoutcommand.h)
-../interface/readscanenablecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readscanenablecommand.h)
-../interface/writescanenablecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writescanenablecommand.h)
-../interface/readpagescanactivitycommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescanactivitycommand.h)
-../interface/writepagescanactivitycommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescanactivitycommand.h)
-../interface/readinquiryscanactivitycommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryscanactivitycommand.h)
-../interface/writeinquiryscanactivitycommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryscanactivitycommand.h)
-../interface/readauthenticationenablecommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readauthenticationenablecommand.h)
-../interface/writeauthenticationenablecommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeauthenticationenablecommand.h)
-../interface/readclassofdevicecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclassofdevicecommand.h)
-../interface/writeclassofdevicecommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeclassofdevicecommand.h)
-../interface/readvoicesettingcommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readvoicesettingcommand.h)
-../interface/writevoicesettingcommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writevoicesettingcommand.h)
-../interface/readautomaticflushtimeoutcommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readautomaticflushtimeoutcommand.h)
-../interface/writeautomaticflushtimeoutcommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeautomaticflushtimeoutcommand.h)
-../interface/readnumbroadcastretransmissionscommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readnumbroadcastretransmissionscommand.h)
-../interface/writenumbroadcastretransmissionscommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writenumbroadcastretransmissionscommand.h)
-../interface/readholdmodeactivitycommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readholdmodeactivitycommand.h)
-../interface/writeholdmodeactivitycommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeholdmodeactivitycommand.h)
-../interface/readtransmitpowerlevelcommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readtransmitpowerlevelcommand.h)
-../interface/readsynchronousflowcontrolenablecommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readsynchronousflowcontrolenablecommand.h)
-../interface/writesynchronousflowcontrolenablecommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesynchronousflowcontrolenablecommand.h)
-../interface/setcontrollertohostflowcontrolcommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setcontrollertohostflowcontrolcommand.h)
-../interface/hostbuffersizecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hostbuffersizecommand.h)
-../interface/hostnumberofcompletedpacketscommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hostnumberofcompletedpacketscommand.h)
-../interface/readlinksupervisiontimeoutcommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinksupervisiontimeoutcommand.h)
-../interface/writelinksupervisiontimeoutcommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelinksupervisiontimeoutcommand.h)
-../interface/readnumberofsupportediaccommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readnumberofsupportediaccommand.h)
-../interface/readcurrentiaclapcommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readcurrentiaclapcommand.h)
-../interface/writecurrentiaclapcommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writecurrentiaclapcommand.h)
-../interface/setafhhostchannelclassificationcommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setafhhostchannelclassificationcommand.h)
-../interface/readinquiryscantypecommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryscantypecommand.h)
-../interface/writeinquiryscantypecommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryscantypecommand.h)
-../interface/readinquirymodecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquirymodecommand.h)
-../interface/writeinquirymodecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquirymodecommand.h)
-../interface/readpagescantypecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescantypecommand.h)
-../interface/writepagescantypecommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescantypecommand.h)
-../interface/readafhchannelassessmentmodecommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readafhchannelassessmentmodecommand.h)
-../interface/writeafhchannelassessmentmodecommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeafhchannelassessmentmodecommand.h)
-../interface/readextendedinquiryresponsecommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readextendedinquiryresponsecommand.h)
-../interface/writeextendedinquiryresponsecommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeextendedinquiryresponsecommand.h)
-../interface/refreshencryptionkeycommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/refreshencryptionkeycommand.h)
-../interface/readsimplepairingmodecommand.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readsimplepairingmodecommand.h)
-../interface/writesimplepairingmodecommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesimplepairingmodecommand.h)
-../interface/readlocaloobdatacommand.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocaloobdatacommand.h)
-../interface/readinquiryresponsetransmitpowerlevelcommand.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryresponsetransmitpowerlevelcommand.h)
-../interface/writeinquiryresponsetransmitpowerlevelcommand.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryresponsetransmitpowerlevelcommand.h)
-../interface/sendkeypressnotificationcommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sendkeypressnotificationcommand.h)
-../interface/readdefaulterroneousdatareportingcommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readdefaulterroneousdatareportingcommand.h)
-../interface/writedefaulterroneousdatareportingcommand.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writedefaulterroneousdatareportingcommand.h)
-../interface/enhancedflushcommand.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/enhancedflushcommand.h)
+../interface/seteventmaskcommand.h								OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/seteventmaskcommand.h)
+../interface/resetcommand.h										OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/resetcommand.h)
+../interface/seteventfiltercommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/seteventfiltercommand.h)
+../interface/flushcommand.h										OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/flushcommand.h)
+../interface/readpintypecommand.h								OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpintypecommand.h)
+../interface/writepintypecommand.h								OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepintypecommand.h)
+../interface/createnewunitkeycommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/createnewunitkeycommand.h)
+../interface/readstoredlinkkeycommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readstoredlinkkeycommand.h)
+../interface/writestoredlinkkeycommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writestoredlinkkeycommand.h)
+../interface/deletestoredlinkkeycommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/deletestoredlinkkeycommand.h)
+../interface/WriteLocalNameCommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelocalnamecommand.h)
+../interface/ReadLocalNameCommand.h								OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalnamecommand.h)
+../interface/readconnectionaccepttimeoutcommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readconnectionaccepttimeoutcommand.h)
+../interface/writeconnectionaccepttimeoutcommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeconnectionaccepttimeoutcommand.h)
+../interface/readpagetimeoutcommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagetimeoutcommand.h)
+../interface/writepagetimeoutcommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagetimeoutcommand.h)
+../interface/readscanenablecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readscanenablecommand.h)
+../interface/writescanenablecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writescanenablecommand.h)
+../interface/readpagescanactivitycommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescanactivitycommand.h)
+../interface/writepagescanactivitycommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescanactivitycommand.h)
+../interface/readinquiryscanactivitycommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryscanactivitycommand.h)
+../interface/writeinquiryscanactivitycommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryscanactivitycommand.h)
+../interface/readauthenticationenablecommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readauthenticationenablecommand.h)
+../interface/writeauthenticationenablecommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeauthenticationenablecommand.h)
+../interface/readclassofdevicecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclassofdevicecommand.h)
+../interface/writeclassofdevicecommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeclassofdevicecommand.h)
+../interface/readvoicesettingcommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readvoicesettingcommand.h)
+../interface/writevoicesettingcommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writevoicesettingcommand.h)
+../interface/readautomaticflushtimeoutcommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readautomaticflushtimeoutcommand.h)
+../interface/writeautomaticflushtimeoutcommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeautomaticflushtimeoutcommand.h)
+../interface/readnumbroadcastretransmissionscommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readnumbroadcastretransmissionscommand.h)
+../interface/writenumbroadcastretransmissionscommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writenumbroadcastretransmissionscommand.h)
+../interface/readholdmodeactivitycommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readholdmodeactivitycommand.h)
+../interface/writeholdmodeactivitycommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeholdmodeactivitycommand.h)
+../interface/readtransmitpowerlevelcommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readtransmitpowerlevelcommand.h)
+../interface/readsynchronousflowcontrolenablecommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readsynchronousflowcontrolenablecommand.h)
+../interface/writesynchronousflowcontrolenablecommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesynchronousflowcontrolenablecommand.h)
+../interface/setcontrollertohostflowcontrolcommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setcontrollertohostflowcontrolcommand.h)
+../interface/hostbuffersizecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hostbuffersizecommand.h)
+../interface/hostnumberofcompletedpacketscommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hostnumberofcompletedpacketscommand.h)
+../interface/readlinksupervisiontimeoutcommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinksupervisiontimeoutcommand.h)
+../interface/writelinksupervisiontimeoutcommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelinksupervisiontimeoutcommand.h)
+../interface/readnumberofsupportediaccommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readnumberofsupportediaccommand.h)
+../interface/readcurrentiaclapcommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readcurrentiaclapcommand.h)
+../interface/writecurrentiaclapcommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writecurrentiaclapcommand.h)
+../interface/setafhhostchannelclassificationcommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setafhhostchannelclassificationcommand.h)
+../interface/readinquiryscantypecommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryscantypecommand.h)
+../interface/writeinquiryscantypecommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryscantypecommand.h)
+../interface/readinquirymodecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquirymodecommand.h)
+../interface/writeinquirymodecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquirymodecommand.h)
+../interface/readpagescantypecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescantypecommand.h)
+../interface/writepagescantypecommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescantypecommand.h)
+../interface/readafhchannelassessmentmodecommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readafhchannelassessmentmodecommand.h)
+../interface/writeafhchannelassessmentmodecommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeafhchannelassessmentmodecommand.h)
+../interface/readextendedinquiryresponsecommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readextendedinquiryresponsecommand.h)
+../interface/writeextendedinquiryresponsecommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeextendedinquiryresponsecommand.h)
+../interface/refreshencryptionkeycommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/refreshencryptionkeycommand.h)
+../interface/readsimplepairingmodecommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readsimplepairingmodecommand.h)
+../interface/writesimplepairingmodecommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesimplepairingmodecommand.h)
+../interface/readlocaloobdatacommand.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocaloobdatacommand.h)
+../interface/readinquiryresponsetransmitpowerlevelcommand.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryresponsetransmitpowerlevelcommand.h)
+../interface/writeinquiryresponsetransmitpowerlevelcommand.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryresponsetransmitpowerlevelcommand.h)
+../interface/sendkeypressnotificationcommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sendkeypressnotificationcommand.h)
+../interface/readdefaulterroneousdatareportingcommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readdefaulterroneousdatareportingcommand.h)
+../interface/writedefaulterroneousdatareportingcommand.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writedefaulterroneousdatareportingcommand.h)
+../interface/enhancedflushcommand.h								OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/enhancedflushcommand.h)
 //
 // Informational Parameters
 //
-../interface/readlocalversioninfocommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalversioninfocommand.h)
-../interface/readlocalsupportedcommandscommand.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalsupportedcommandscommand.h)
-../interface/readlocalsupportedfeaturescommand.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalsupportedfeaturescommand.h)
-../interface/readlocalextendedfeaturescommand.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalextendedfeaturescommand.h)
-../interface/readbuffersizecommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readbuffersizecommand.h)
-../interface/readbdaddrcommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readbdaddrcommand.h)
+../interface/readlocalversioninfocommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalversioninfocommand.h)
+../interface/readlocalsupportedcommandscommand.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalsupportedcommandscommand.h)
+../interface/readlocalsupportedfeaturescommand.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalsupportedfeaturescommand.h)
+../interface/readlocalextendedfeaturescommand.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalextendedfeaturescommand.h)
+../interface/readbuffersizecommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readbuffersizecommand.h)
+../interface/readbdaddrcommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readbdaddrcommand.h)
 //
 // Status Parameters
 //
-../interface/readfailedcontactcountercommand.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readfailedcontactcountercommand.h)
-../interface/resetfailedcontactcountercommand.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/resetfailedcontactcountercommand.h)
-../interface/readlinkqualitycommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinkqualitycommand.h)
-../interface/readrssicommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readrssicommand.h)
-../interface/readafhchannelmapcommand.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readafhchannelmapcommand.h)
-../interface/readclockcommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclockcommand.h)
+../interface/readfailedcontactcountercommand.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readfailedcontactcountercommand.h)
+../interface/resetfailedcontactcountercommand.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/resetfailedcontactcountercommand.h)
+../interface/readlinkqualitycommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinkqualitycommand.h)
+../interface/readrssicommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readrssicommand.h)
+../interface/readafhchannelmapcommand.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readafhchannelmapcommand.h)
+../interface/readclockcommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclockcommand.h)
 //
 // Testing Commands
 //
-../interface/readloopbackmodecommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readloopbackmodecommand.h)
-../interface/writeloopbackmodecommand.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeloopbackmodecommand.h)
-../interface/enabledeviceundertestmodecommand.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/enabledeviceundertestmodecommand.h)
-../interface/writesimplepairingdebugmodecommand.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesimplepairingdebugmodecommand.h)
+../interface/readloopbackmodecommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readloopbackmodecommand.h)
+../interface/writeloopbackmodecommand.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeloopbackmodecommand.h)
+../interface/enabledeviceundertestmodecommand.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/enabledeviceundertestmodecommand.h)
+../interface/writesimplepairingdebugmodecommand.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesimplepairingdebugmodecommand.h)
 
 // Command Complete Events
 // Nop
-../interface/nopcompleteevent.h										SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/nopcompleteevent.h)
+../interface/nopcompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/nopcompleteevent.h)
 //
 // Link Control Commands
 //
-../interface/inquirycancelcompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquirycancelcompleteevent.h)
-../interface/periodicinquirymodecompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/periodicinquirymodecompleteevent.h)
-../interface/exitperiodicinquirymodecompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/exitperiodicinquirymodecompleteevent.h)
-../interface/createconnectioncancelcompleteevent.h 					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/createconnectioncancelcompleteevent.h)
-../interface/linkkeyrequestreplycompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeyrequestreplycompleteevent.h)
-../interface/linkkeyrequestreplynegativecompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeyrequestreplynegativecompleteevent.h)
-../interface/pincoderequestreplycompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pincoderequestreplycompleteevent.h)
-../interface/pincoderequestreplynegativecompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pincoderequestreplynegativecompleteevent.h)
-../interface/remotenamerequestcancelcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remotenamerequestcancelcompleteevent.h)
-../interface/readlmphandlecompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlmphandlecompleteevent.h)
-../interface/iocapabilityrequestreplycompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityrequestreplycompleteevent.h)
-../interface/userconfirmationrequestreplycompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userconfirmationrequestreplycompleteevent.h)
-../interface/userconfirmationrequestnegativereplycompleteevent.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userconfirmationrequestnegativereplycompleteevent.h)
-../interface/userpasskeyrequestreplycompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeyrequestreplycompleteevent.h)
-../interface/userpasskeyrequestnegativereplycompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeyrequestnegativereplycompleteevent.h)
-../interface/remoteoobdatarequestreplycompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remoteoobdatarequestreplycompleteevent.h)
-../interface/remoteoobdatarequestnegativereplycompleteevent.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remoteoobdatarequestnegativereplycompleteevent.h)
-../interface/iocapabilityrequestnegativereplycompleteevent.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityrequestnegativereplycompleteevent.h)
+../interface/inquirycancelcompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquirycancelcompleteevent.h)
+../interface/periodicinquirymodecompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/periodicinquirymodecompleteevent.h)
+../interface/exitperiodicinquirymodecompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/exitperiodicinquirymodecompleteevent.h)
+../interface/createconnectioncancelcompleteevent.h 					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/createconnectioncancelcompleteevent.h)
+../interface/linkkeyrequestreplycompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeyrequestreplycompleteevent.h)
+../interface/linkkeyrequestreplynegativecompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeyrequestreplynegativecompleteevent.h)
+../interface/pincoderequestreplycompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pincoderequestreplycompleteevent.h)
+../interface/pincoderequestreplynegativecompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pincoderequestreplynegativecompleteevent.h)
+../interface/remotenamerequestcancelcompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remotenamerequestcancelcompleteevent.h)
+../interface/readlmphandlecompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlmphandlecompleteevent.h)
+../interface/iocapabilityrequestreplycompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityrequestreplycompleteevent.h)
+../interface/userconfirmationrequestreplycompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userconfirmationrequestreplycompleteevent.h)
+../interface/userconfirmationrequestnegativereplycompleteevent.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userconfirmationrequestnegativereplycompleteevent.h)
+../interface/userpasskeyrequestreplycompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeyrequestreplycompleteevent.h)
+../interface/userpasskeyrequestnegativereplycompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeyrequestnegativereplycompleteevent.h)
+../interface/remoteoobdatarequestreplycompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remoteoobdatarequestreplycompleteevent.h)
+../interface/remoteoobdatarequestnegativereplycompleteevent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remoteoobdatarequestnegativereplycompleteevent.h)
+../interface/iocapabilityrequestnegativereplycompleteevent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityrequestnegativereplycompleteevent.h)
 //
 // Link Policy Commands
 //
-../interface/rolediscoverycompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/rolediscoverycompleteevent.h)
-../interface/readlinkpolicysettingscompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinkpolicysettingscompleteevent.h)
-../interface/writelinkpolicysettingscompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelinkpolicysettingscompleteevent.h)
-../interface/readdefaultlinkpolicysettingscompleteevent.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readdefaultlinkpolicysettingscompleteevent.h)
-../interface/writedefaultlinkpolicysettingscompleteevent.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writedefaultlinkpolicysettingscompleteevent.h)
-../interface/sniffsubratingcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sniffsubratingcompleteevent.h)
+../interface/rolediscoverycompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/rolediscoverycompleteevent.h)
+../interface/readlinkpolicysettingscompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinkpolicysettingscompleteevent.h)
+../interface/writelinkpolicysettingscompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelinkpolicysettingscompleteevent.h)
+../interface/readdefaultlinkpolicysettingscompleteevent.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readdefaultlinkpolicysettingscompleteevent.h)
+../interface/writedefaultlinkpolicysettingscompleteevent.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writedefaultlinkpolicysettingscompleteevent.h)
+../interface/sniffsubratingcompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sniffsubratingcompleteevent.h)
 //
 // Controller and Baseband Commands
 //
-../interface/seteventmaskcompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/seteventmaskcompleteevent.h)
-../interface/resetcompleteevent.h									SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/resetcompleteevent.h)
-../interface/seteventfiltercompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/seteventfiltercompleteevent.h)
-../interface/flushcompleteevent.h									SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/flushcompleteevent.h)
-../interface/readpintypecompleteevent.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpintypecompleteevent.h)
-../interface/writepintypecompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepintypecompleteevent.h)
-../interface/createnewunitkeycompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/createnewunitkeycompleteevent.h)
-../interface/readstoredlinkkeycompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readstoredlinkkeycompleteevent.h)
-../interface/writestoredlinkkeycompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writestoredlinkkeycompleteevent.h)
-../interface/deletestoredlinkkeycompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/deletestoredlinkkeycompleteevent.h)
-../interface/writelocalnamecompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelocalnamecompleteevent.h)
-../interface/ReadLocalNameCompleteEvent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalnamecompleteevent.h)
-../interface/readconnectionaccepttimeoutcompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readconnectionaccepttimeoutcompleteevent.h)
-../interface/writeconnectionaccepttimeoutcompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeconnectionaccepttimeoutcompleteevent.h)
-../interface/readpagetimeoutcompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagetimeoutcompleteevent.h)
-../interface/writepagetimeoutcompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagetimeoutcompleteevent.h)
-../interface/readscanenablecompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readscanenablecompleteevent.h)
-../interface/writescanenablecompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writescanenablecompleteevent.h)
-../interface/readpagescanactivitycompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescanactivitycompleteevent.h)
-../interface/writepagescanactivitycompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescanactivitycompleteevent.h)
-../interface/readinquiryscanactivitycompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryscanactivitycompleteevent.h)
-../interface/writeinquiryscanactivitycompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryscanactivitycompleteevent.h)
-../interface/readauthenticationenablecompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readauthenticationenablecompleteevent.h)
-../interface/writeauthenticationenablecompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeauthenticationenablecompleteevent.h)
-../interface/readclassofdevicecompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclassofdevicecompleteevent.h)
-../interface/writeclassofdevicecompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeclassofdevicecompleteevent.h)
-../interface/readvoicesettingcompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readvoicesettingcompleteevent.h)
-../interface/writevoicesettingcompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writevoicesettingcompleteevent.h)
-../interface/readautomaticflushtimeoutcompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readautomaticflushtimeoutcompleteevent.h)
-../interface/writeautomaticflushtimeoutcompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeautomaticflushtimeoutcompleteevent.h)
-../interface/readnumbroadcastretransmissionscompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readnumbroadcastretransmissionscompleteevent.h)
-../interface/writenumbroadcastretransmissionscompleteevent.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writenumbroadcastretransmissionscompleteevent.h)
-../interface/readholdmodeactivitycompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readholdmodeactivitycompleteevent.h)
-../interface/writeholdmodeactivitycompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeholdmodeactivitycompleteevent.h)
-../interface/readtransmitpowerlevelcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readtransmitpowerlevelcompleteevent.h)
-../interface/readsynchronousflowcontrolenablecompleteevent.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readsynchronousflowcontrolenablecompleteevent.h)
-../interface/writesynchronousflowcontrolenablecompleteevent.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesynchronousflowcontrolenablecompleteevent.h)
-../interface/setcontrollertohostflowcontrolcompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setcontrollertohostflowcontrolcompleteevent.h)
-../interface/hostbuffersizecompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hostbuffersizecompleteevent.h)
-../interface/hostnumberofcompletedpacketscompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hostnumberofcompletedpacketscompleteevent.h)
-../interface/readlinksupervisiontimeoutcompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinksupervisiontimeoutcompleteevent.h)
-../interface/writelinksupervisiontimeoutcompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelinksupervisiontimeoutcompleteevent.h)
-../interface/readnumberofsupportediaccompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readnumberofsupportediaccompleteevent.h)
-../interface/readcurrentiaclapcompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readcurrentiaclapcompleteevent.h)
-../interface/writecurrentiaclapcompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writecurrentiaclapcompleteevent.h)
-../interface/setafhhostchannelclassificationcompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setafhhostchannelclassificationcompleteevent.h)
-../interface/readinquiryscantypecompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryscantypecompleteevent.h)
-../interface/writeinquiryscantypecompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryscantypecompleteevent.h)
-../interface/readinquirymodecompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquirymodecompleteevent.h)
-../interface/writeinquirymodecompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquirymodecompleteevent.h)
-../interface/readpagescantypecompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescantypecompleteevent.h)
-../interface/writepagescantypecompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescantypecompleteevent.h)
-../interface/readafhchannelassessmentmodecompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readafhchannelassessmentmodecompleteevent.h)
-../interface/writeafhchannelassessmentmodecompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeafhchannelassessmentmodecompleteevent.h)
-../interface/readextendedinquiryresponsecompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readextendedinquiryresponsecompleteevent.h)
-../interface/writeextendedinquiryresponsecompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeextendedinquiryresponsecompleteevent.h)
-../interface/readsimplepairingmodecompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readsimplepairingmodecompleteevent.h)
-../interface/writesimplepairingmodecompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesimplepairingmodecompleteevent.h)
-../interface/readlocaloobdatacompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocaloobdatacompleteevent.h)
-../interface/readinquiryresponsetransmitpowerlevelcompleteevent.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryresponsetransmitpowerlevelcompleteevent.h)
-../interface/writeinquiryresponsetransmitpowerlevelcompleteevent.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryresponsetransmitpowerlevelcompleteevent.h)
-../interface/sendkeypressnotificationcompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sendkeypressnotificationcompleteevent.h)
-../interface/readdefaulterroneousdatareportingcompleteevent.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readdefaulterroneousdatareportingcompleteevent.h)
-../interface/writedefaulterroneousdatareportingcompleteevent.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writedefaulterroneousdatareportingcompleteevent.h)
+../interface/seteventmaskcompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/seteventmaskcompleteevent.h)
+../interface/resetcompleteevent.h									OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/resetcompleteevent.h)
+../interface/seteventfiltercompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/seteventfiltercompleteevent.h)
+../interface/flushcompleteevent.h									OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/flushcompleteevent.h)
+../interface/readpintypecompleteevent.h								OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpintypecompleteevent.h)
+../interface/writepintypecompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepintypecompleteevent.h)
+../interface/createnewunitkeycompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/createnewunitkeycompleteevent.h)
+../interface/readstoredlinkkeycompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readstoredlinkkeycompleteevent.h)
+../interface/writestoredlinkkeycompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writestoredlinkkeycompleteevent.h)
+../interface/deletestoredlinkkeycompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/deletestoredlinkkeycompleteevent.h)
+../interface/writelocalnamecompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelocalnamecompleteevent.h)
+../interface/ReadLocalNameCompleteEvent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalnamecompleteevent.h)
+../interface/readconnectionaccepttimeoutcompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readconnectionaccepttimeoutcompleteevent.h)
+../interface/writeconnectionaccepttimeoutcompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeconnectionaccepttimeoutcompleteevent.h)
+../interface/readpagetimeoutcompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagetimeoutcompleteevent.h)
+../interface/writepagetimeoutcompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagetimeoutcompleteevent.h)
+../interface/readscanenablecompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readscanenablecompleteevent.h)
+../interface/writescanenablecompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writescanenablecompleteevent.h)
+../interface/readpagescanactivitycompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescanactivitycompleteevent.h)
+../interface/writepagescanactivitycompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescanactivitycompleteevent.h)
+../interface/readinquiryscanactivitycompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryscanactivitycompleteevent.h)
+../interface/writeinquiryscanactivitycompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryscanactivitycompleteevent.h)
+../interface/readauthenticationenablecompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readauthenticationenablecompleteevent.h)
+../interface/writeauthenticationenablecompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeauthenticationenablecompleteevent.h)
+../interface/readclassofdevicecompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclassofdevicecompleteevent.h)
+../interface/writeclassofdevicecompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeclassofdevicecompleteevent.h)
+../interface/readvoicesettingcompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readvoicesettingcompleteevent.h)
+../interface/writevoicesettingcompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writevoicesettingcompleteevent.h)
+../interface/readautomaticflushtimeoutcompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readautomaticflushtimeoutcompleteevent.h)
+../interface/writeautomaticflushtimeoutcompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeautomaticflushtimeoutcompleteevent.h)
+../interface/readnumbroadcastretransmissionscompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readnumbroadcastretransmissionscompleteevent.h)
+../interface/writenumbroadcastretransmissionscompleteevent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writenumbroadcastretransmissionscompleteevent.h)
+../interface/readholdmodeactivitycompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readholdmodeactivitycompleteevent.h)
+../interface/writeholdmodeactivitycompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeholdmodeactivitycompleteevent.h)
+../interface/readtransmitpowerlevelcompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readtransmitpowerlevelcompleteevent.h)
+../interface/readsynchronousflowcontrolenablecompleteevent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readsynchronousflowcontrolenablecompleteevent.h)
+../interface/writesynchronousflowcontrolenablecompleteevent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesynchronousflowcontrolenablecompleteevent.h)
+../interface/setcontrollertohostflowcontrolcompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setcontrollertohostflowcontrolcompleteevent.h)
+../interface/hostbuffersizecompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hostbuffersizecompleteevent.h)
+../interface/hostnumberofcompletedpacketscompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hostnumberofcompletedpacketscompleteevent.h)
+../interface/readlinksupervisiontimeoutcompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinksupervisiontimeoutcompleteevent.h)
+../interface/writelinksupervisiontimeoutcompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writelinksupervisiontimeoutcompleteevent.h)
+../interface/readnumberofsupportediaccompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readnumberofsupportediaccompleteevent.h)
+../interface/readcurrentiaclapcompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readcurrentiaclapcompleteevent.h)
+../interface/writecurrentiaclapcompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writecurrentiaclapcompleteevent.h)
+../interface/setafhhostchannelclassificationcompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/setafhhostchannelclassificationcompleteevent.h)
+../interface/readinquiryscantypecompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryscantypecompleteevent.h)
+../interface/writeinquiryscantypecompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryscantypecompleteevent.h)
+../interface/readinquirymodecompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquirymodecompleteevent.h)
+../interface/writeinquirymodecompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquirymodecompleteevent.h)
+../interface/readpagescantypecompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescantypecompleteevent.h)
+../interface/writepagescantypecompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescantypecompleteevent.h)
+../interface/readafhchannelassessmentmodecompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readafhchannelassessmentmodecompleteevent.h)
+../interface/writeafhchannelassessmentmodecompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeafhchannelassessmentmodecompleteevent.h)
+../interface/readextendedinquiryresponsecompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readextendedinquiryresponsecompleteevent.h)
+../interface/writeextendedinquiryresponsecompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeextendedinquiryresponsecompleteevent.h)
+../interface/readsimplepairingmodecompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readsimplepairingmodecompleteevent.h)
+../interface/writesimplepairingmodecompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesimplepairingmodecompleteevent.h)
+../interface/readlocaloobdatacompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocaloobdatacompleteevent.h)
+../interface/readinquiryresponsetransmitpowerlevelcompleteevent.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readinquiryresponsetransmitpowerlevelcompleteevent.h)
+../interface/writeinquiryresponsetransmitpowerlevelcompleteevent.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeinquiryresponsetransmitpowerlevelcompleteevent.h)
+../interface/sendkeypressnotificationcompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sendkeypressnotificationcompleteevent.h)
+../interface/readdefaulterroneousdatareportingcompleteevent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readdefaulterroneousdatareportingcompleteevent.h)
+../interface/writedefaulterroneousdatareportingcompleteevent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writedefaulterroneousdatareportingcompleteevent.h)
 //
 // Informational Parameters
 //
-../interface/readlocalversioninfocompleteevent.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalversioninfocompleteevent.h)
-../interface/readlocalsupportedcommandscompleteevent.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalsupportedcommandscompleteevent.h)
-../interface/readlocalsupportedfeaturescompleteevent.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalsupportedfeaturescompleteevent.h)
-../interface/readlocalextendedfeaturescompleteevent.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalextendedfeaturescompleteevent.h)
-../interface/readbuffersizecompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readbuffersizecompleteevent.h)
-../interface/readbdaddrcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readbdaddrcompleteevent.h)
+../interface/readlocalversioninfocompleteevent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalversioninfocompleteevent.h)
+../interface/readlocalsupportedcommandscompleteevent.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalsupportedcommandscompleteevent.h)
+../interface/readlocalsupportedfeaturescompleteevent.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalsupportedfeaturescompleteevent.h)
+../interface/readlocalextendedfeaturescompleteevent.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlocalextendedfeaturescompleteevent.h)
+../interface/readbuffersizecompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readbuffersizecompleteevent.h)
+../interface/readbdaddrcompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readbdaddrcompleteevent.h)
 //
 // Status Parameters
 //
-../interface/readfailedcontactcountercompleteevent.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readfailedcontactcountercompleteevent.h)
-../interface/resetfailedcontactcountercompleteevent.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/resetfailedcontactcountercompleteevent.h)
-../interface/readlinkqualitycompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinkqualitycompleteevent.h)
-../interface/readrssicompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readrssicompleteevent.h)
-../interface/readafhchannelmapcompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readafhchannelmapcompleteevent.h)
-../interface/readclockcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclockcompleteevent.h)
+../interface/readfailedcontactcountercompleteevent.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readfailedcontactcountercompleteevent.h)
+../interface/resetfailedcontactcountercompleteevent.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/resetfailedcontactcountercompleteevent.h)
+../interface/readlinkqualitycompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readlinkqualitycompleteevent.h)
+../interface/readrssicompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readrssicompleteevent.h)
+../interface/readafhchannelmapcompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readafhchannelmapcompleteevent.h)
+../interface/readclockcompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclockcompleteevent.h)
 //
 // Testing Commands
 //
-../interface/readloopbackmodecompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readloopbackmodecompleteevent.h)
-../interface/writeloopbackmodecompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeloopbackmodecompleteevent.h)
-../interface/enabledeviceundertestmodecompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/enabledeviceundertestmodecompleteevent.h)
-../interface/writesimplepairingdebugmodecompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesimplepairingdebugmodecompleteevent.h)
+../interface/readloopbackmodecompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readloopbackmodecompleteevent.h)
+../interface/writeloopbackmodecompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeloopbackmodecompleteevent.h)
+../interface/enabledeviceundertestmodecompleteevent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/enabledeviceundertestmodecompleteevent.h)
+../interface/writesimplepairingdebugmodecompleteevent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writesimplepairingdebugmodecompleteevent.h)
 
 // Events
-../interface/inquirycompleteevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquirycompleteevent.h)
-../interface/inquiryresultevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquiryresultevent.h)
-../interface/connectioncompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/connectioncompleteevent.h)
-../interface/connectionrequestevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/connectionrequestevent.h)
-../interface/disconnectioncompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/disconnectioncompleteevent.h)
-../interface/authenticationcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/authenticationcompleteevent.h)
-../interface/remotenamereqcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remotenamereqcompleteevent.h)
-../interface/encryptionchangeevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/encryptionchangeevent.h)
-../interface/changelinkkeyevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/changelinkkeyevent.h)
-../interface/masterlinkkeyevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/masterlinkkeyevent.h)
-../interface/readremsuppfeatcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremsuppfeatcompleteevent.h)
-../interface/readremverinfocompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremverinfocompleteevent.h)
-../interface/qossetupcompleteevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/qossetupcompleteevent.h)
-../interface/commandstatusevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/commandstatusevent.h)
-../interface/hardwareerrorevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hardwareerrorevent.h)
-../interface/flushoccurredevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/flushoccurredevent.h)
-../interface/rolechangeevent.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/rolechangeevent.h)
-../interface/numberofcompletedpacketsevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/numberofcompletedpacketsevent.h)
-../interface/modechangeevent.h								SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/modechangeevent.h)
-../interface/returnlinkkeysevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/returnlinkkeysevent.h)
-../interface/pincoderequestevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pincoderequestevent.h)
-../interface/linkkeyrequestevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeyrequestevent.h)
-../interface/linkkeynotificationevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeynotificationevent.h)
-../interface/loopbackcommandevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/loopbackcommandevent.h)
-../interface/databufferoverflowevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/databufferoverflowevent.h)
-../interface/maxslotschangeevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/maxslotschangeevent.h)
-../interface/readclockoffsetevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclockoffsetevent.h)
-../interface/connectionpackettypechangedevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/connectionpackettypechangedevent.h)
-../interface/qosviolationevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/qosviolationevent.h)
-../interface/pagescanrepetitionmodechangeevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pagescanrepetitionmodechangeevent.h)
-../interface/flowspecificationcompleteevent.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/flowspecificationcompleteevent.h)
-../interface/inquiryresultwithrssievent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquiryresultwithrssievent.h)
-../interface/readremoteextendedfeaturescompleteevent.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremoteextendedfeaturescompleteevent.h)
-../interface/synchronousconnectioncompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/synchronousconnectioncompleteevent.h)
-../interface/synchronousconnectionchangedevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/synchronousconnectionchangedevent.h)
-../interface/sniffsubratingevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sniffsubratingevent.h)
-../interface/extendedinquiryresultevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/extendedinquiryresultevent.h)
-../interface/encryptionkeyrefreshcompleteevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/encryptionkeyrefreshcompleteevent.h)
-../interface/iocapabilityrequestevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityrequestevent.h)
-../interface/iocapabilityresponseevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityresponseevent.h)
-../interface/userconfirmationrequestevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userconfirmationrequestevent.h)
-../interface/userpasskeyrequestevent.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeyrequestevent.h)
-../interface/remoteoobdatarequestevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remoteoobdatarequestevent.h)
-../interface/simplepairingcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/simplepairingcompleteevent.h)
-../interface/linksupervisiontimeoutchangedevent.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linksupervisiontimeoutchangedevent.h)
-../interface/enhancedflushcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/enhancedflushcompleteevent.h)
-../interface/userpasskeynotificationevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeynotificationevent.h)
-../interface/keypressnotificationevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/keypressnotificationevent.h)
-../interface/remotehostsupportedfeaturesnotificationevent.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remotehostsupportedfeaturesnotificationevent.h)
+../interface/inquirycompleteevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquirycompleteevent.h)
+../interface/inquiryresultevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquiryresultevent.h)
+../interface/connectioncompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/connectioncompleteevent.h)
+../interface/connectionrequestevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/connectionrequestevent.h)
+../interface/disconnectioncompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/disconnectioncompleteevent.h)
+../interface/authenticationcompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/authenticationcompleteevent.h)
+../interface/remotenamereqcompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remotenamereqcompleteevent.h)
+../interface/encryptionchangeevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/encryptionchangeevent.h)
+../interface/changelinkkeyevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/changelinkkeyevent.h)
+../interface/masterlinkkeyevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/masterlinkkeyevent.h)
+../interface/readremsuppfeatcompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremsuppfeatcompleteevent.h)
+../interface/readremverinfocompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremverinfocompleteevent.h)
+../interface/qossetupcompleteevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/qossetupcompleteevent.h)
+../interface/commandstatusevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/commandstatusevent.h)
+../interface/hardwareerrorevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hardwareerrorevent.h)
+../interface/flushoccurredevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/flushoccurredevent.h)
+../interface/rolechangeevent.h								OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/rolechangeevent.h)
+../interface/numberofcompletedpacketsevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/numberofcompletedpacketsevent.h)
+../interface/modechangeevent.h								OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/modechangeevent.h)
+../interface/returnlinkkeysevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/returnlinkkeysevent.h)
+../interface/pincoderequestevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pincoderequestevent.h)
+../interface/linkkeyrequestevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeyrequestevent.h)
+../interface/linkkeynotificationevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linkkeynotificationevent.h)
+../interface/loopbackcommandevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/loopbackcommandevent.h)
+../interface/databufferoverflowevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/databufferoverflowevent.h)
+../interface/maxslotschangeevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/maxslotschangeevent.h)
+../interface/readclockoffsetevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readclockoffsetevent.h)
+../interface/connectionpackettypechangedevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/connectionpackettypechangedevent.h)
+../interface/qosviolationevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/qosviolationevent.h)
+../interface/pagescanrepetitionmodechangeevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pagescanrepetitionmodechangeevent.h)
+../interface/flowspecificationcompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/flowspecificationcompleteevent.h)
+../interface/inquiryresultwithrssievent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/inquiryresultwithrssievent.h)
+../interface/readremoteextendedfeaturescompleteevent.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readremoteextendedfeaturescompleteevent.h)
+../interface/synchronousconnectioncompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/synchronousconnectioncompleteevent.h)
+../interface/synchronousconnectionchangedevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/synchronousconnectionchangedevent.h)
+../interface/sniffsubratingevent.h							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/sniffsubratingevent.h)
+../interface/extendedinquiryresultevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/extendedinquiryresultevent.h)
+../interface/encryptionkeyrefreshcompleteevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/encryptionkeyrefreshcompleteevent.h)
+../interface/iocapabilityrequestevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityrequestevent.h)
+../interface/iocapabilityresponseevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/iocapabilityresponseevent.h)
+../interface/userconfirmationrequestevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userconfirmationrequestevent.h)
+../interface/userpasskeyrequestevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeyrequestevent.h)
+../interface/remoteoobdatarequestevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remoteoobdatarequestevent.h)
+../interface/simplepairingcompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/simplepairingcompleteevent.h)
+../interface/linksupervisiontimeoutchangedevent.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/linksupervisiontimeoutchangedevent.h)
+../interface/enhancedflushcompleteevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/enhancedflushcompleteevent.h)
+../interface/userpasskeynotificationevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/userpasskeynotificationevent.h)
+../interface/keypressnotificationevent.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/keypressnotificationevent.h)
+../interface/remotehostsupportedfeaturesnotificationevent.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/remotehostsupportedfeaturesnotificationevent.h)
 
 // Deprecated Commands and Events
-../interface/readpagescanperiodcommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescanperiodcommand.h)
-../interface/readpagescanperiodcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescanperiodcompleteevent.h)
-../interface/writepagescanperiodcommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescanperiodcommand.h)
-../interface/writepagescanperiodcompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescanperiodcompleteevent.h)
-../interface/addscoconnectioncommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/addscoconnectioncommand.h)
-../interface/pagescanmodechangeevent.h							SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pagescanmodechangeevent.h)
-../interface/readencryptionmodecommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readencryptionmodecommand.h)
-../interface/readencryptionmodecompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readencryptionmodecompleteevent.h)
-../interface/writeencryptionmodecommand.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeencryptionmodecommand.h)
-../interface/writeencryptionmodecompleteevent.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeencryptionmodecompleteevent.h)
+../interface/readpagescanperiodcommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescanperiodcommand.h)
+../interface/readpagescanperiodcompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readpagescanperiodcompleteevent.h)
+../interface/writepagescanperiodcommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescanperiodcommand.h)
+../interface/writepagescanperiodcompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writepagescanperiodcompleteevent.h)
+../interface/addscoconnectioncommand.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/addscoconnectioncommand.h)
+../interface/pagescanmodechangeevent.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/pagescanmodechangeevent.h)
+../interface/readencryptionmodecommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readencryptionmodecommand.h)
+../interface/readencryptionmodecompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/readencryptionmodecompleteevent.h)
+../interface/writeencryptionmodecommand.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeencryptionmodecommand.h)
+../interface/writeencryptionmodecompleteevent.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/writeencryptionmodecompleteevent.h)
 
 
 // DEF files for the implementation to use.
-../BWINS/commandseventsU.def							/epoc32/include/bluetooth/hci/bwins/commandseventsu.def
-../EABI/commandseventsU.def							/epoc32/include/bluetooth/hci/eabi/commandseventsu.def
+../BWINS/commandseventsU.def							OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/bwins/commandseventsu.def)
+../EABI/commandseventsU.def								OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/eabi/commandseventsu.def)
 
 PRJ_MMPFILES
 commandsevents_base.mmp
--- a/bthci/bthci2/btpowercontrol/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/btpowercontrol/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -16,13 +16,9 @@
 // 
 //
 
-/**
- @file
-*/
-
 PRJ_EXPORTS
-../interface/btpowercontrol.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/btpowercontrol.h)
-../interface/btpowercontrolmessages.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/btpowercontrolmessages.h)
+../interface/btpowercontrol.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/btpowercontrol.h)
+../interface/btpowercontrolmessages.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/btpowercontrolmessages.h)
 
 PRJ_MMPFILES
 btpowercontrol.mmp
--- a/bthci/bthci2/dutmode/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/dutmode/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -16,7 +16,7 @@
 //
 
 PRJ_EXPORTS
-../interface/dutmode.h		/epoc32/include/bluetooth/dutmode.h
+../interface/dutmode.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/dutmode.h)
 
 
 PRJ_MMPFILES
--- a/bthci/bthci2/dutmode/interface/dutmode.h	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/dutmode/interface/dutmode.h	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -22,7 +22,6 @@
 #define BLUETOOTH_DUT_MODE_H
 
 #include <e32base.h>
-#include <bluetooth/hci/hcitypes.h>
 
 class RHCIServerSession;
 
--- a/bthci/bthci2/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -32,25 +32,25 @@
 hci_framework.iby  /epoc32/rom/include/hci_framework.iby
 
 PRJ_EXPORTS
-../corehci/interface/aclpacketconsts.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/aclpacketconsts.h)
-../corehci/interface/basebandpacketconsts.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/basebandpacketconsts.h)
-../corehci/interface/CoreHCI.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/corehci.h)
-../corehci/interface/corehciplugin.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/corehciplugin.h)
-../corehci/interface/hcibase.hrh					/epoc32/include/bluetooth/hci/hcibase.hrh
-../corehci/interface/hciconsts.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciconsts.h)
-../corehci/interface/HciCommandAllocator.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcicommandallocator.h)
-../corehci/interface/HciDataEventObserver.h 		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcidataeventobserver.h)
-../corehci/interface/HciCommandEventObserver.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hcicommandeventobserver.h)
-../corehci/interface/HciDataFramer.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcidataframer.h)
-../corehci/interface/HciDataObserver.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcidataobserver.h)
-../corehci/interface/hcierrors.h					SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/hci/hcierrors.h)
-../corehci/interface/hcievents.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcievents.h)
-../corehci/interface/hciframe.h 					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciframe.h)
-../corehci/interface/hcitypes.h 					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcitypes.h)
-../corehci/interface/hciclientusage.h 				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciclientusage.h)
+../corehci/interface/aclpacketconsts.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/aclpacketconsts.h)
+../corehci/interface/basebandpacketconsts.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/basebandpacketconsts.h)
+../corehci/interface/CoreHCI.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/corehci.h)
+../corehci/interface/corehciplugin.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/corehciplugin.h)
+../corehci/interface/hcibase.hrh					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcibase.hrh)
+../corehci/interface/hciconsts.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciconsts.h)
+../corehci/interface/HciCommandAllocator.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcicommandallocator.h)
+../corehci/interface/HciDataEventObserver.h 		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcidataeventobserver.h)
+../corehci/interface/HciCommandEventObserver.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hcicommandeventobserver.h)
+../corehci/interface/HciDataFramer.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcidataframer.h)
+../corehci/interface/HciDataObserver.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcidataobserver.h)
+../corehci/interface/hcierrors.h					OS_LAYER_PUBLIC_EXPORT_PATH(bluetooth/hci/hcierrors.h)
+../corehci/interface/hcievents.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcievents.h)
+../corehci/interface/hciframe.h 					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciframe.h)
+../corehci/interface/hcitypes.h 					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcitypes.h)
+../corehci/interface/hciclientusage.h 				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciclientusage.h)
 
-../CommandsEvents/interface/hciopcodes.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciopcodes.h)
+../CommandsEvents/interface/hciopcodes.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciopcodes.h)
 
-../hctl/interface/hctlchannelobserver.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctlchannelobserver.h)
+../hctl/interface/hctlchannelobserver.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctlchannelobserver.h)
 
-../hciserverclient/interface/hciipc.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciipc.h)
+../hciserverclient/interface/hciipc.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciipc.h)
--- a/bthci/bthci2/group/hci_framework.iby	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/group/hci_framework.iby	Thu Sep 23 17:06:47 2010 +0300
@@ -32,6 +32,6 @@
 file=ABI_DIR\HCIF_DIR\hcicmdq.dll				System\Libs\hcicmdq.dll
 
 REM Command Queue configuration file
-data=ZPRIVATE\101F7989\Bluetooth\cmdq.ini	Private\101F7989\Bluetooth\cmdq.ini
+data=ZPRIVATE\101f7989\bluetooth\cmdq.ini	Private\101F7989\Bluetooth\cmdq.ini
 
 #endif //  HCI_FRAMEWORK_IBY
--- a/bthci/bthci2/hcicmdq/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/hcicmdq/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -14,16 +14,13 @@
 //
 
 PRJ_EXPORTS
-../interface/HciCommandQItem.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hcicommandqitem.h)
-../interface/HCICommandQueue.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hcicommandqueue.h)
-../interface/HciCommandQueueClient.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hcicommandqueueclient.h)
-../interface/HciCmdQController.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hcicmdqcontroller.h)
+../interface/HciCommandQItem.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hcicommandqitem.h)
+../interface/HCICommandQueue.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hcicommandqueue.h)
+../interface/HciCommandQueueClient.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hcicommandqueueclient.h)
+../interface/HciCmdQController.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hcicmdqcontroller.h)
 
-cmdq.ini /epoc32/data/z/private/101f7989/bluetooth/cmdq.ini
-cmdq.ini /epoc32/release/winscw/udeb/z/private/101f7989/bluetooth/cmdq.ini // for winscw UDEB
-cmdq.ini /epoc32/release/winscw/urel/z/private/101f7989/bluetooth/cmdq.ini // for winscw UREL
+cmdq.ini z:/private/101f7989/bluetooth/cmdq.ini
 
 PRJ_MMPFILES
 HCICmdQ.mmp
 
-PRJ_TESTMMPFILES
--- a/bthci/bthci2/hciserverclient/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/hciserverclient/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -14,7 +14,7 @@
 //
 
 PRJ_EXPORTS
-../interface/hciserverclient.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hciserverclient.h)
+../interface/hciserverclient.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hciserverclient.h)
 
 PRJ_MMPFILES
 hciserverclient.mmp
--- a/bthci/bthci2/hciutil/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/hciutil/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -14,8 +14,8 @@
 //
 
 PRJ_EXPORTS
-../interface/hciutil.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciutil.h)
-../interface/hciinifile.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciinifile.h)
+../interface/hciutil.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciutil.h)
+../interface/hciinifile.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hciinifile.h)
 
 PRJ_MMPFILES
 hciutil.mmp
--- a/bthci/bthci2/hctl/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/hctl/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -14,19 +14,19 @@
 //
 
 PRJ_EXPORTS
-../interface/delay.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/delay.h)
-../interface/hctlbase.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctlbase.h)
-../interface/hctlbase.hrh					/epoc32/include/bluetooth/hci/hctlbase.hrh
-../interface/hctldataobserver.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctldataobserver.h)
-../interface/hctleventobserver.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctleventobserver.h)
-../interface/hctlinterface.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctlinterface.h)
-../interface/hctluartbase.h					SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctluartbase.h)
-../interface/QdpPluginInterfaceFinder.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/qdpplugininterfacefinder.h)
-../interface/HctlPowerInterface.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctlpowerinterface.h)
-../interface/hctluartpowermanager.h			SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctluartpowermanager.h)
-../interface/hctluartpowerobserver.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctluartpowerobserver.h)
+../interface/delay.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/delay.h)
+../interface/hctlbase.h						OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctlbase.h)
+../interface/hctlbase.hrh					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctlbase.hrh)
+../interface/hctldataobserver.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctldataobserver.h)
+../interface/hctleventobserver.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctleventobserver.h)
+../interface/hctlinterface.h				OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctlinterface.h)
+../interface/hctluartbase.h					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctluartbase.h)
+../interface/QdpPluginInterfaceFinder.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/qdpplugininterfacefinder.h)
+../interface/HctlPowerInterface.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctlpowerinterface.h)
+../interface/hctluartpowermanager.h			OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctluartpowermanager.h)
+../interface/hctluartpowerobserver.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctluartpowerobserver.h)
 // NB The interface in this file is re-used by observers of the HCI also.
-../interface/controllerstateobserver.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/controllerstateobserver.h)
+../interface/controllerstateobserver.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/controllerstateobserver.h)
 
 PRJ_MMPFILES
 hctl_base.mmp
--- a/bthci/bthci2/initialisor/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/initialisor/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -14,10 +14,10 @@
 //
 
 PRJ_EXPORTS
-../interface/ControllerInitialisationInterface.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/controllerinitialisationinterface.h)
-../interface/ControllerInitialisationPlugin.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/controllerinitialisationplugin.h)
-../interface/initialisorbase.hrh /epoc32/include/bluetooth/hci/initialisorbase.hrh
-../interface/ControllerInitialisationObserver.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/controllerinitialisationobserver.h)
+../interface/ControllerInitialisationInterface.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/controllerinitialisationinterface.h)
+../interface/ControllerInitialisationPlugin.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/controllerinitialisationplugin.h)
+../interface/initialisorbase.hrh OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/initialisorbase.hrh)
+../interface/ControllerInitialisationObserver.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/controllerinitialisationobserver.h)
 
 PRJ_MMPFILES
 initialisor_base.mmp
--- a/bthci/bthci2/qdp/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/bthci2/qdp/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -14,9 +14,9 @@
 //
 
 PRJ_EXPORTS
-../interface/HciCmdQueueDecisionInterface.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcicmdqueuedecisioninterface.h)
-../interface/HciCmdQueueDecisionPlugin.h	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcicmdqueuedecisionplugin.h)
-../interface/qdpbase.hrh					/epoc32/include/bluetooth/hci/qdpbase.hrh
+../interface/HciCmdQueueDecisionInterface.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcicmdqueuedecisioninterface.h)
+../interface/HciCmdQueueDecisionPlugin.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hcicmdqueuedecisionplugin.h)
+../interface/qdpbase.hrh					OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/qdpbase.hrh)
 
 PRJ_MMPFILES
 qdp_base.mmp
--- a/bthci/hci2implementations/CommandsEvents/symbian/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/hci2implementations/CommandsEvents/symbian/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-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"
@@ -14,9 +14,9 @@
 //
 
 PRJ_EXPORTS
-commandsevents_symbian.iby		/epoc32/rom/include/commandsevents_symbian.iby
-../inc/commandbaseextension.h						SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/commandbaseextension.h)
-../inc/completingeventqueryhelper.h				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/completingeventqueryhelper.h)
+commandsevents_symbian.iby			/epoc32/rom/include/commandsevents_symbian.iby
+../inc/commandbaseextension.h		OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/commandbaseextension.h)
+../inc/completingeventqueryhelper.h	OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/completingeventqueryhelper.h)
 
 PRJ_MMPFILES
 commandsevents_symbian.mmp
--- a/bthci/hci2implementations/CommandsEvents/symbian/group/commandsevents_symbian.mmp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/hci2implementations/CommandsEvents/symbian/group/commandsevents_symbian.mmp	Thu Sep 23 17:06:47 2010 +0300
@@ -353,9 +353,9 @@
 // against the exported .def files (which define the ordinals the .lib file is expecting of the implemenation).
 NOEXPORTLIBRARY
 #ifdef WINS
-DEFFILE /epoc32/include/bluetooth/hci/bwins/commandsevents.def
+DEFFILE OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/bwins/commandsevents.def)
 #else
-DEFFILE /epoc32/include/bluetooth/hci/eabi/commandsevents.def
+DEFFILE OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/eabi/commandsevents.def)
 #endif
 
 OPTION cw -strict on -w pedantic,unused,hidevirtual,padding,ptrintconv
--- a/bthci/hci2implementations/hctls/ti/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/hci2implementations/hctls/ti/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -14,12 +14,9 @@
 //
 
 PRJ_EXPORTS
-../inc/HCTLConfigInterface.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctlconfiginterface.h)
+../inc/HCTLConfigInterface.h OS_LAYER_PLATFORM_EXPORT_PATH(bluetooth/hci/hctlconfiginterface.h)
 
-hctl_ti.ini /epoc32/data/z/private/101f7989/bluetooth/hctl_ti.ini
-
-hctl_ti.ini /epoc32/release/winscw/udeb/z/private/101f7989/bluetooth/hctl_ti.ini // For WINSCW UDEB builds
-hctl_ti.ini /epoc32/release/winscw/urel/z/private/101f7989/bluetooth/hctl_ti.ini // For WINSCW UREL builds
+hctl_ti.ini z:/private/101f7989/bluetooth/hctl_ti.ini
 
 hctl_ti.iby /epoc32/rom/include/hctl_ti.iby
 
--- a/bthci/hciextensioninterface/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/hciextensioninterface/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-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"
@@ -14,7 +14,7 @@
 //
 
 PRJ_EXPORTS
-inc/hciproxy.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(hciproxy.h)
+inc/hciproxy.h OS_LAYER_PLATFORM_EXPORT_PATH(hciproxy.h)
 HCIProxy.iby /epoc32/rom/include/hciproxy.iby
 
 PRJ_MMPFILES
--- a/bthci/hciextensioninterface/tsrc/tproxy.cpp	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/hciextensioninterface/tsrc/tproxy.cpp	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -20,10 +20,11 @@
 #include <f32file.h>
 #include <bt_sock.h>
 #include <c32comm.h>
-#include "btmanclient.h"
+#include <btmanclient.h>
 #include "debug.h"
 #include <btsdp.h>
 #include <hciproxy.h>
+#include <bluetooth/hci/hciopcodes.h>
 
 #if defined (__WINS__)
 #define PDD_NAME _L("ECDRV")
--- a/bthci/hciextensioninterface/tsrc/tproxycorehci/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/hciextensioninterface/tsrc/tproxycorehci/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -17,16 +17,10 @@
 //
 
 PRJ_TESTEXPORTS
-../inc/HCICOREPLUGINIMPL.H SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(HCICOREPLUGINIMPL.H)
-
-bluetooth_stack.ini /epoc32/data/z/private/101f7989/bluetooth/bluetooth_stack.ini //For ARMV5 
-corehci_tproxy.ini /epoc32/data/z/private/101f7989/bluetooth/corehci_tproxy.ini
+../inc/HCICOREPLUGINIMPL.H OS_LAYER_PLATFORM_EXPORT_PATH(HCICOREPLUGINIMPL.H)
 
-bluetooth_stack.ini /epoc32/release/winscw/udeb/z/private/101f7989/bluetooth/bluetooth_stack.ini // For WINSCW debugging
-corehci_tproxy.ini /epoc32/release/winscw/udeb/z/private/101f7989/bluetooth/corehci_tproxy.ini
-
-bluetooth_stack.ini /epoc32/release/winscw/urel/z/private/101f7989/bluetooth/bluetooth_stack.ini // For WINSCW debugging
-corehci_tproxy.ini /epoc32/release/winscw/urel/z/private/101f7989/bluetooth/corehci_tproxy.ini
+bluetooth_stack.ini z:/private/101f7989/bluetooth/bluetooth_stack.ini
+corehci_tproxy.ini z:/private/101f7989/bluetooth/corehci_tproxy.ini
 
 corehci_tproxy.iby /epoc32/rom/include/corehci_tproxy.iby
 
--- a/bthci/hciextensioninterface/tsrc/tproxycorehci/group/bluetooth_stack.ini	Wed Jul 21 15:42:05 2010 +0300
+++ b/bthci/hciextensioninterface/tsrc/tproxycorehci/group/bluetooth_stack.ini	Thu Sep 23 17:06:47 2010 +0300
@@ -18,6 +18,3 @@
 
 [CoreHci]
 EcomUid= 0x10286A7B
-
-[lowpowermodeconfiguration]
-overridelpmtimeout_microseconds= 0
\ No newline at end of file
--- a/irda/irdastack/group/bld.inf	Wed Jul 21 15:42:05 2010 +0300
+++ b/irda/irdastack/group/bld.inf	Thu Sep 23 17:06:47 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-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"
@@ -15,26 +15,21 @@
 // 
 //
 
-/**
- @file
-*/
-
-
 PRJ_EXPORTS
 
-../INC/IR_SOCK.H SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(ir_sock.h)
+../INC/IR_SOCK.H OS_LAYER_PUBLIC_EXPORT_PATH(ir_sock.h)
 
-../INC/irdaextensions.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(irdaextensions.h)
+../INC/irdaextensions.h OS_LAYER_PLATFORM_EXPORT_PATH(irdaextensions.h)
 
-../irtranp/tranp.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(tranp.h)
+../irtranp/tranp.h OS_LAYER_PUBLIC_EXPORT_PATH(tranp.h)
 
-../INC/irerr.ra				/epoc32/include/errors/generic/irerr.ra
-../INC/irerr.rls			/epoc32/include/errors/generic/irerr.rls
+../INC/irerr.ra				OS_LAYER_PUBLIC_EXPORT_PATH(errors/generic/irerr.ra)
+../INC/irerr.rls			OS_LAYER_PUBLIC_EXPORT_PATH(errors/generic/irerr.rls)
 
-../INC/irda.rh				SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(irda.rh)
+../INC/irda.rh				OS_LAYER_PLATFORM_EXPORT_PATH(irda.rh)
 	
 
-../group/irda.iby			/epoc32/rom/include/irda.iby	
+../group/irda.iby			/epoc32/rom/include/irda.iby
 
 PRJ_MMPFILES
 
--- a/irda/irdastack/group/irda.iby	Wed Jul 21 15:42:05 2010 +0300
+++ b/irda/irdastack/group/irda.iby	Thu Sep 23 17:06:47 2010 +0300
@@ -31,8 +31,6 @@
 #include <commsdebugutility.iby>
 #endif
 
-#include <obexprotocol.iby>
-
 REM *** irda.dll and irtranp.dll (Infrared Transfer Picture) are
 REM *** client side dlls. They are always included in the ROM whether
 REM *** IRDA is supported by the device or not, so that client