From 10018c28befa0f82f7f9ea0d6cf9b00622285dc7 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Thu, 1 Feb 2018 10:03:37 -0800 Subject: [PATCH] PDU data lengty computation fix PDU data must also account for PDU length and Channel ID fields. Otherwise each PDU is split into 2 BB packets, decreasing the link speed. Test: manual data transimssion test. Change-Id: I026bf0e32c58eec620b5c55d748ecd81fa3ea67b --- stack/l2cap/l2c_fcr.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack/l2cap/l2c_fcr.cc b/stack/l2cap/l2c_fcr.cc index d9cbba128..9464cfdb1 100644 --- a/stack/l2cap/l2c_fcr.cc +++ b/stack/l2cap/l2c_fcr.cc @@ -1795,7 +1795,7 @@ BT_HDR* l2c_fcr_get_next_xmit_sdu_seg(tL2C_CCB* p_ccb, * returned PDU is last piece from this SDU.*/ BT_HDR* l2c_lcc_get_next_xmit_sdu_seg(tL2C_CCB* p_ccb, bool* last_piece_of_sdu) { - uint16_t max_pdu = p_ccb->peer_conn_cfg.mps; + uint16_t max_pdu = p_ccb->peer_conn_cfg.mps - 4 /* Length and CID */; BT_HDR* p_buf = (BT_HDR*)fixed_queue_try_peek_first(p_ccb->xmit_hold_q); bool first_pdu = (p_buf->event == 0) ? true : false; -- 2.11.0