bluetooth/btstack/l2cap/L2CapSDUQueue.h
changeset 51 20ac952a623c
parent 0 29b1cd4cb562
--- a/bluetooth/btstack/l2cap/L2CapSDUQueue.h	Thu Sep 23 17:06:47 2010 +0300
+++ b/bluetooth/btstack/l2cap/L2CapSDUQueue.h	Wed Oct 13 16:20:29 2010 +0300
@@ -66,6 +66,7 @@
 	                             TUint16 aFlushTimeout, 
 	                             TUint16 aMaxOutgoingMTU,
 	                             TUint16 aMaxIncomingMTU,
+	                             TUint16 aAclBufSize,
 	                             TBool aCanDropSdus);
 	static CL2CapSDUQueue* NewL(CL2CAPConnectionSAP& aL2CapSap,
                                 TL2CAPPort aLocalCID,
@@ -77,6 +78,7 @@
 	                            TUint16 aFlushTimeout, 
                                 TUint16 aMaxOutgoingMTU,
                                 TUint16 aMaxIncomingMTU,
+                                TUint16 aAclBufSize,
                                 TBool aCanDropSdus);
  
 	~CL2CapSDUQueue();
@@ -113,7 +115,8 @@
 	                    TUint16 aFlushTimeout, 
 	                    TUint16 aPDUSize,
 	                    TUint16 aMaxOutgoingMTU,
-	                    TUint16 aMaxIncomingMTU);
+	                    TUint16 aMaxIncomingMTU,
+	                    TUint16 aAclBufSize);
 	void UpdateChannelPriority(TUint8 aNewPriority);
 	void ErrorD(TInt aErrorCode);
 
@@ -122,17 +125,15 @@
 	void PretendIncomingSduQFull(TBool aIncomingSduQFull);
 #endif
 
+	inline TUint GetOptimalMTUSizeL();
+	TUint GetOptimalMTUSizeL(TUint aMtuRestriction, TUint16 aAclBufSize);
+
 	inline TUint16 MaxOutgoingMTU() const;
 	inline TUint16 MaxIncomingMTU() const;
 
-	inline TUint16 MaximumPDUSize() const;
-	inline TUint16 OptimalPDUSize() const;
-	inline void SetOptimalPDUSize(TUint16 aPDUSize);
-
-	TBool IsBasicDataVersion() const;
-
 private:
-	void ConstructL(TL2CAPPort aLocalCID, TL2CAPPort aRemoteCID, CL2CAPMux& aMuxer, TL2CapDataControllerConfig* aConfig);
+	void ConstructL(TL2CAPPort aLocalCID, TL2CAPPort aRemoteCID, CL2CAPMux& aMuxer,
+					TL2CapDataControllerConfig* aConfig, TUint16 aAclBufSize);
 	
 	CL2CapSDUQueue(CL2CAPConnectionSAP& aL2CapSap,
 				   TUint8 aOutboundQueueSize,
@@ -212,19 +213,13 @@
 	return iMaxIncomingMTU;
 	}
 
-inline TUint16 CL2CapSDUQueue::MaximumPDUSize() const
-	{
-	return iMaximumPDUSize;
-	}
-
-inline TUint16 CL2CapSDUQueue::OptimalPDUSize() const
+inline TUint CL2CapSDUQueue::GetOptimalMTUSizeL()
 	{
-	return iCurrentPDUSize;
-	}
-
-inline void CL2CapSDUQueue::SetOptimalPDUSize(TUint16 aPDUSize)
-	{
-	iCurrentPDUSize = aPDUSize;
+	// Pass in 0 as controller buffer size - it's only used in optimal PDU size
+	// calculation, which in turn is only done if a smaller than negotiated MTU
+	// size is passed in, and that's not the case here (iMaxOutgoingMTU is the
+	// negotiated L2CAP MTU).
+	return GetOptimalMTUSizeL(iMaxOutgoingMTU, 0);
 	}
 
 inline void CL2CapSDUQueue::SuspendSDUQueue()