bluetooth/btstack/avdtp/avdtpDirectChannel.cpp
changeset 34 9d84592f5036
parent 0 29b1cd4cb562
child 51 20ac952a623c
child 56 015fa7494bd2
--- a/bluetooth/btstack/avdtp/avdtpDirectChannel.cpp	Mon Jul 12 07:03:47 2010 +0300
+++ b/bluetooth/btstack/avdtp/avdtpDirectChannel.cpp	Mon Jul 12 07:06:31 2010 +0300
@@ -45,15 +45,28 @@
 	LOG_FUNC
 	}
 		
-TInt CDirectChannel::AttachTransportSession(CUserPlaneTransportSession& aSession, TAvdtpTransportSessionType /*aType*/)
+TInt CDirectChannel::AttachTransportSession(CUserPlaneTransportSession& aSession, TAvdtpTransportSessionType /*aType*/, TL2CapConfig::TChannelPriority aPriority)
 	{
 	LOG_FUNC
 	__ASSERT_DEBUG(!iTransportSession, Panic(EAVDTPBadSessionAttachToTransportChannel));
-	// don't care about session type for direct channels
 	iTransportSession = &aSession;
+	iChannelPriority = aPriority;
+	UpdateChannelPriority();
 	return KErrNone;
 	}
 	
+void CDirectChannel::UpdateChannelPriority()
+	{
+	LOG_FUNC
+	
+	if(iLogicalChannel)
+		{
+		TPckgBuf<TL2CapConfig> configBuf;
+		configBuf().ConfigureChannelPriority(iChannelPriority);
+		(void)iLogicalChannel->SetOption(KSolBtL2CAP, KL2CAPUpdateChannelConfig, configBuf);
+		}
+	}
+
 TBool CDirectChannel::CouldAttachSession(const TAvdtpSockAddr& /*aAddr*/)
 	{
 	LOG_FUNC
@@ -136,6 +149,10 @@
 	LOG_FUNC
 	__ASSERT_DEBUG(&aSession == iTransportSession, Panic(EAVDTPBadSessionDetachFromTransportChannel));
 	iTransportSession = NULL;
+	iChannelPriority = TL2CapConfig::ELow;
+	
+	UpdateChannelPriority();
+	
 	// closing logical channel is async - we die on CanClose
 	// but we're invalid, so tell protocol
 	Protocol().TransportChannelClosing(*this);