From c6602a61ddd2f22f5e36d63114b2f9a2478ab5d1 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 4 Mar 2021 09:49:29 +0100 Subject: [PATCH] hci: use 4 bytes HCI_OUTGOING_PRE_BUFFER_SIZE if not defined and ENABLE_H5 is defined --- src/hci.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/hci.h b/src/hci.h index 1fd2d918f..ce9872658 100644 --- a/src/hci.h +++ b/src/hci.h @@ -135,13 +135,19 @@ extern "C" { #endif #endif -// additional pre-buffer space for packets to Bluetooth module, for now, used for HCI Transport H4 DMA +// additional pre-buffer space for packets to Bluetooth module +// - H4 requires 1 byte for the packet type +// - h5 requires 4 bytes for H5 header #ifndef HCI_OUTGOING_PRE_BUFFER_SIZE -#ifdef HAVE_HOST_CONTROLLER_API -#define HCI_OUTGOING_PRE_BUFFER_SIZE 0 -#else -#define HCI_OUTGOING_PRE_BUFFER_SIZE 1 -#endif + #ifdef HAVE_HOST_CONTROLLER_API + #define HCI_OUTGOING_PRE_BUFFER_SIZE 0 + #else + #ifdef ENABLE_H5 + #define HCI_OUTGOING_PRE_BUFFER_SIZE 4 + #else + #define HCI_OUTGOING_PRE_BUFFER_SIZE 1 + #endif + #endif #endif // BNEP may uncompress the IP Header by 16 bytes, GATT Client requires two additional bytes for long characteristic reads