bluetooth/btstack/l2cap/L2CapSDUQueue.h
changeset 51 20ac952a623c
parent 0 29b1cd4cb562
equal deleted inserted replaced
48:22de2e391156 51:20ac952a623c
    64   	                             TUint8 aOutboundQueueSize,
    64   	                             TUint8 aOutboundQueueSize,
    65 	                             TL2CapDataControllerConfig* aConfig,
    65 	                             TL2CapDataControllerConfig* aConfig,
    66 	                             TUint16 aFlushTimeout, 
    66 	                             TUint16 aFlushTimeout, 
    67 	                             TUint16 aMaxOutgoingMTU,
    67 	                             TUint16 aMaxOutgoingMTU,
    68 	                             TUint16 aMaxIncomingMTU,
    68 	                             TUint16 aMaxIncomingMTU,
       
    69 	                             TUint16 aAclBufSize,
    69 	                             TBool aCanDropSdus);
    70 	                             TBool aCanDropSdus);
    70 	static CL2CapSDUQueue* NewL(CL2CAPConnectionSAP& aL2CapSap,
    71 	static CL2CapSDUQueue* NewL(CL2CAPConnectionSAP& aL2CapSap,
    71                                 TL2CAPPort aLocalCID,
    72                                 TL2CAPPort aLocalCID,
    72                                 TL2CAPPort aRemoteCID,
    73                                 TL2CAPPort aRemoteCID,
    73 	                            CL2CAPMux& aMuxer,
    74 	                            CL2CAPMux& aMuxer,
    75 	                            TUint8 aOutboundQueueSize,
    76 	                            TUint8 aOutboundQueueSize,
    76 	                            TL2CapDataControllerConfig* aConfig,
    77 	                            TL2CapDataControllerConfig* aConfig,
    77 	                            TUint16 aFlushTimeout, 
    78 	                            TUint16 aFlushTimeout, 
    78                                 TUint16 aMaxOutgoingMTU,
    79                                 TUint16 aMaxOutgoingMTU,
    79                                 TUint16 aMaxIncomingMTU,
    80                                 TUint16 aMaxIncomingMTU,
       
    81                                 TUint16 aAclBufSize,
    80                                 TBool aCanDropSdus);
    82                                 TBool aCanDropSdus);
    81  
    83  
    82 	~CL2CapSDUQueue();
    84 	~CL2CapSDUQueue();
    83 
    85 
    84 	static TInt CanSendAsyncCallBack(TAny *aSDUQueue);
    86 	static TInt CanSendAsyncCallBack(TAny *aSDUQueue);
   111 	inline void SuspendSDUQueue();
   113 	inline void SuspendSDUQueue();
   112 	void ResumeSDUQueue(TL2CapDataControllerConfig* aConfig,
   114 	void ResumeSDUQueue(TL2CapDataControllerConfig* aConfig,
   113 	                    TUint16 aFlushTimeout, 
   115 	                    TUint16 aFlushTimeout, 
   114 	                    TUint16 aPDUSize,
   116 	                    TUint16 aPDUSize,
   115 	                    TUint16 aMaxOutgoingMTU,
   117 	                    TUint16 aMaxOutgoingMTU,
   116 	                    TUint16 aMaxIncomingMTU);
   118 	                    TUint16 aMaxIncomingMTU,
       
   119 	                    TUint16 aAclBufSize);
   117 	void UpdateChannelPriority(TUint8 aNewPriority);
   120 	void UpdateChannelPriority(TUint8 aNewPriority);
   118 	void ErrorD(TInt aErrorCode);
   121 	void ErrorD(TInt aErrorCode);
   119 
   122 
   120 #ifdef _DEBUG
   123 #ifdef _DEBUG
   121 	TInt GetDataPlaneConfig(TL2DataPlaneConfig& conf) const;
   124 	TInt GetDataPlaneConfig(TL2DataPlaneConfig& conf) const;
   122 	void PretendIncomingSduQFull(TBool aIncomingSduQFull);
   125 	void PretendIncomingSduQFull(TBool aIncomingSduQFull);
   123 #endif
   126 #endif
   124 
   127 
       
   128 	inline TUint GetOptimalMTUSizeL();
       
   129 	TUint GetOptimalMTUSizeL(TUint aMtuRestriction, TUint16 aAclBufSize);
       
   130 
   125 	inline TUint16 MaxOutgoingMTU() const;
   131 	inline TUint16 MaxOutgoingMTU() const;
   126 	inline TUint16 MaxIncomingMTU() const;
   132 	inline TUint16 MaxIncomingMTU() const;
   127 
   133 
   128 	inline TUint16 MaximumPDUSize() const;
       
   129 	inline TUint16 OptimalPDUSize() const;
       
   130 	inline void SetOptimalPDUSize(TUint16 aPDUSize);
       
   131 
       
   132 	TBool IsBasicDataVersion() const;
       
   133 
       
   134 private:
   134 private:
   135 	void ConstructL(TL2CAPPort aLocalCID, TL2CAPPort aRemoteCID, CL2CAPMux& aMuxer, TL2CapDataControllerConfig* aConfig);
   135 	void ConstructL(TL2CAPPort aLocalCID, TL2CAPPort aRemoteCID, CL2CAPMux& aMuxer,
       
   136 					TL2CapDataControllerConfig* aConfig, TUint16 aAclBufSize);
   136 	
   137 	
   137 	CL2CapSDUQueue(CL2CAPConnectionSAP& aL2CapSap,
   138 	CL2CapSDUQueue(CL2CAPConnectionSAP& aL2CapSap,
   138 				   TUint8 aOutboundQueueSize,
   139 				   TUint8 aOutboundQueueSize,
   139 	               TUint16 aPDUSize,
   140 	               TUint16 aPDUSize,
   140 	               TUint16 aFlushTimeout, 
   141 	               TUint16 aFlushTimeout, 
   210 inline TUint16 CL2CapSDUQueue::MaxIncomingMTU() const
   211 inline TUint16 CL2CapSDUQueue::MaxIncomingMTU() const
   211 	{
   212 	{
   212 	return iMaxIncomingMTU;
   213 	return iMaxIncomingMTU;
   213 	}
   214 	}
   214 
   215 
   215 inline TUint16 CL2CapSDUQueue::MaximumPDUSize() const
   216 inline TUint CL2CapSDUQueue::GetOptimalMTUSizeL()
   216 	{
   217 	{
   217 	return iMaximumPDUSize;
   218 	// Pass in 0 as controller buffer size - it's only used in optimal PDU size
   218 	}
   219 	// calculation, which in turn is only done if a smaller than negotiated MTU
   219 
   220 	// size is passed in, and that's not the case here (iMaxOutgoingMTU is the
   220 inline TUint16 CL2CapSDUQueue::OptimalPDUSize() const
   221 	// negotiated L2CAP MTU).
   221 	{
   222 	return GetOptimalMTUSizeL(iMaxOutgoingMTU, 0);
   222 	return iCurrentPDUSize;
       
   223 	}
       
   224 
       
   225 inline void CL2CapSDUQueue::SetOptimalPDUSize(TUint16 aPDUSize)
       
   226 	{
       
   227 	iCurrentPDUSize = aPDUSize;
       
   228 	}
   223 	}
   229 
   224 
   230 inline void CL2CapSDUQueue::SuspendSDUQueue()
   225 inline void CL2CapSDUQueue::SuspendSDUQueue()
   231 	{
   226 	{
   232 	iOutboundQueueSuspended = ETrue;
   227 	iOutboundQueueSuspended = ETrue;