From 27fa55229924e980af123526005ad8c424c6bd70 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Mon, 15 Aug 2022 18:46:29 +0530 Subject: [PATCH] Add extra space for buffer allocation for ESP IP --- nimble/host/include/host/ble_hs.h | 2 ++ nimble/host/src/ble_hs_mbuf.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/nimble/host/include/host/ble_hs.h b/nimble/host/include/host/ble_hs.h index 43979ba57..50fb9eb23 100644 --- a/nimble/host/include/host/ble_hs.h +++ b/nimble/host/include/host/ble_hs.h @@ -54,6 +54,8 @@ extern "C" { /** Connection handle not present */ #define BLE_HS_CONN_HANDLE_NONE 0xffff +#define BLE_HS_CTRL_DATA_HDR_SZ 0x4 + /** * @brief Bluetooth Host Error Code * @defgroup bt_host_err Bluetooth Host Error Code diff --git a/nimble/host/src/ble_hs_mbuf.c b/nimble/host/src/ble_hs_mbuf.c index ea660c633..e748ae121 100644 --- a/nimble/host/src/ble_hs_mbuf.c +++ b/nimble/host/src/ble_hs_mbuf.c @@ -66,7 +66,11 @@ ble_hs_mbuf_bare_pkt(void) struct os_mbuf * ble_hs_mbuf_acl_pkt(void) { +#if CONFIG_BT_NIMBLE_LEGACY_VHCI_ENABLE return ble_hs_mbuf_gen_pkt(BLE_HCI_DATA_HDR_SZ + 1); +#else + return ble_hs_mbuf_gen_pkt(BLE_HCI_DATA_HDR_SZ + BLE_HS_CTRL_DATA_HDR_SZ + 1); +#endif } /** @@ -81,7 +85,11 @@ ble_hs_mbuf_acl_pkt(void) struct os_mbuf * ble_hs_mbuf_l2cap_pkt(void) { +#if CONFIG_BT_NIMBLE_LEGACY_VHCI_ENABLE return ble_hs_mbuf_gen_pkt(BLE_HCI_DATA_HDR_SZ + BLE_L2CAP_HDR_SZ + 1); +#else + return ble_hs_mbuf_gen_pkt(BLE_HCI_DATA_HDR_SZ + BLE_L2CAP_HDR_SZ + BLE_HS_CTRL_DATA_HDR_SZ + 1); +#endif } struct os_mbuf *