bluetooth/btstack/avdtp/avdtpDirectChannel.cpp
branchRCL_3
changeset 56 015fa7494bd2
parent 41 786b94c6f0a4
equal deleted inserted replaced
49:10183c6d2913 56:015fa7494bd2
    43 : CTransportChannel(aProtocol, aRemoteDevice)
    43 : CTransportChannel(aProtocol, aRemoteDevice)
    44 	{
    44 	{
    45 	LOG_FUNC
    45 	LOG_FUNC
    46 	}
    46 	}
    47 		
    47 		
    48 TInt CDirectChannel::AttachTransportSession(CUserPlaneTransportSession& aSession, TAvdtpTransportSessionType /*aType*/, TL2CapConfig::TChannelPriority aPriority)
    48 CDirectChannel::~CDirectChannel()
       
    49 	{
       
    50 	LOG_FUNC
       
    51 	}
       
    52 
       
    53 TInt CDirectChannel::AttachTransportSession(CUserPlaneTransportSession& aSession, TAvdtpTransportSessionType /*aType*/)
    49 	{
    54 	{
    50 	LOG_FUNC
    55 	LOG_FUNC
    51 	__ASSERT_DEBUG(!iTransportSession, Panic(EAVDTPBadSessionAttachToTransportChannel));
    56 	__ASSERT_DEBUG(!iTransportSession, Panic(EAVDTPBadSessionAttachToTransportChannel));
       
    57 	// don't care about session type for direct channels
    52 	iTransportSession = &aSession;
    58 	iTransportSession = &aSession;
    53 	iChannelPriority = aPriority;
       
    54 	UpdateChannelPriority();
       
    55 	return KErrNone;
    59 	return KErrNone;
    56 	}
    60 	}
    57 	
    61 	
    58 void CDirectChannel::UpdateChannelPriority()
       
    59 	{
       
    60 	LOG_FUNC
       
    61 	
       
    62 	if(iLogicalChannel)
       
    63 		{
       
    64 		TPckgBuf<TL2CapConfig> configBuf;
       
    65 		configBuf().ConfigureChannelPriority(iChannelPriority);
       
    66 		(void)iLogicalChannel->SetOption(KSolBtL2CAP, KL2CAPUpdateChannelConfig, configBuf);
       
    67 		}
       
    68 	}
       
    69 
       
    70 TBool CDirectChannel::CouldAttachSession(const TAvdtpSockAddr& /*aAddr*/)
    62 TBool CDirectChannel::CouldAttachSession(const TAvdtpSockAddr& /*aAddr*/)
    71 	{
    63 	{
    72 	LOG_FUNC
    64 	LOG_FUNC
    73 	// for this channel we can take iff no session
    65 	// for this channel we can take iff no session
    74 	return (iTransportSession == NULL);
    66 	return (iTransportSession == NULL);
   147 #endif
   139 #endif
   148 	{
   140 	{
   149 	LOG_FUNC
   141 	LOG_FUNC
   150 	__ASSERT_DEBUG(&aSession == iTransportSession, Panic(EAVDTPBadSessionDetachFromTransportChannel));
   142 	__ASSERT_DEBUG(&aSession == iTransportSession, Panic(EAVDTPBadSessionDetachFromTransportChannel));
   151 	iTransportSession = NULL;
   143 	iTransportSession = NULL;
   152 	iChannelPriority = TL2CapConfig::ELow;
       
   153 	
       
   154 	UpdateChannelPriority();
       
   155 	
       
   156 	// closing logical channel is async - we die on CanClose
   144 	// closing logical channel is async - we die on CanClose
   157 	// but we're invalid, so tell protocol
   145 	// but we're invalid, so tell protocol
   158 	Protocol().TransportChannelClosing(*this);
   146 	Protocol().TransportChannelClosing(*this);
   159 	CloseLogicalChannel();
   147 	CloseLogicalChannel();
   160 	}
   148 	}