From b5a7c9b3d582765f56b00fa307c4d6fd9049bed4 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 16 Jan 2017 10:58:54 +0100 Subject: [PATCH] l2cap: reduce minimal HCI_ACL_PAYLOAD_SIZE to 27 for LE only --- src/l2cap.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/l2cap.h b/src/l2cap.h index dc3ebc98a..f27b4d1ab 100644 --- a/src/l2cap.h +++ b/src/l2cap.h @@ -56,9 +56,16 @@ extern "C" { #endif // check L2CAP MTU -#if (L2CAP_MINIMAL_MTU + L2CAP_HEADER_SIZE) > HCI_ACL_PAYLOAD_SIZE +#ifdef ENABLE_CLASSIC +#if (L2CAP_HEADER_SIZE + L2CAP_MINIMAL_MTU) > HCI_ACL_PAYLOAD_SIZE #error "HCI_ACL_PAYLOAD_SIZE too small for minimal L2CAP MTU of 48 bytes" #endif +#endif +#ifdef ENABLE_BLE +#if (L2CAP_HEADER_SIZE + L2CAP_LE_DEFAULT_MTU) > HCI_ACL_PAYLOAD_SIZE +#error "HCI_ACL_PAYLOAD_SIZE too small for minimal L2CAP LE MTU of 23 bytes" +#endif +#endif #define L2CAP_LE_AUTOMATIC_CREDITS 0xffff