diff --git a/nimble/host/include/host/ble_hs.h b/nimble/host/include/host/ble_hs.h index 3014db159..9223f3b3a 100644 --- a/nimble/host/include/host/ble_hs.h +++ b/nimble/host/include/host/ble_hs.h @@ -55,6 +55,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 e67f3a7a6..9c3cbf0a6 100644 --- a/nimble/host/src/ble_hs_mbuf.c +++ b/nimble/host/src/ble_hs_mbuf.c @@ -71,7 +71,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 } /** @@ -86,7 +90,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 *