summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
Diffstat (limited to 'samples')
-rw-r--r--samples/bluetooth/hci_uart/src/main.c10
-rw-r--r--samples/bluetooth/hci_usb/src/main.c10
2 files changed, 8 insertions, 12 deletions
diff --git a/samples/bluetooth/hci_uart/src/main.c b/samples/bluetooth/hci_uart/src/main.c
index 39fdafd13..3924fd42d 100644
--- a/samples/bluetooth/hci_uart/src/main.c
+++ b/samples/bluetooth/hci_uart/src/main.c
@@ -22,6 +22,7 @@
#include <net/buf.h>
#include <bluetooth/bluetooth.h>
+#include <bluetooth/l2cap.h>
#include <bluetooth/log.h>
#include <bluetooth/hci.h>
#include <bluetooth/buf.h>
@@ -31,8 +32,7 @@ static struct device *hci_uart_dev;
static BT_STACK_NOINIT(tx_thread_stack, CONFIG_BLUETOOTH_HCI_TX_STACK_SIZE);
/* HCI command buffers */
-#define CMD_BUF_SIZE (CONFIG_BLUETOOTH_HCI_SEND_RESERVE + \
- sizeof(struct bt_hci_cmd_hdr) + \
+#define CMD_BUF_SIZE (CONFIG_BLUETOOTH_HCI_RESERVE + BT_HCI_CMD_HDR_SIZE + \
CONFIG_BLUETOOTH_MAX_CMD_LEN)
NET_BUF_POOL_DEFINE(cmd_tx_pool, CONFIG_BLUETOOTH_HCI_CMD_COUNT, CMD_BUF_SIZE,
@@ -40,10 +40,8 @@ NET_BUF_POOL_DEFINE(cmd_tx_pool, CONFIG_BLUETOOTH_HCI_CMD_COUNT, CMD_BUF_SIZE,
#define BT_L2CAP_MTU 65 /* 64-byte public key + opcode */
/** Data size needed for ACL buffers */
-#define BT_BUF_ACL_SIZE (CONFIG_BLUETOOTH_HCI_RECV_RESERVE + \
- sizeof(struct bt_hci_acl_hdr) + \
- 4 /* L2CAP header size */ + \
- BT_L2CAP_MTU)
+#define BT_BUF_ACL_SIZE (CONFIG_BLUETOOTH_HCI_RESERVE + BT_HCI_ACL_HDR_SIZE + \
+ BT_L2CAP_HDR_SIZE + BT_L2CAP_MTU)
#if defined(CONFIG_BLUETOOTH_CONTROLLER_TX_BUFFERS)
#define TX_BUF_COUNT CONFIG_BLUETOOTH_CONTROLLER_TX_BUFFERS
diff --git a/samples/bluetooth/hci_usb/src/main.c b/samples/bluetooth/hci_usb/src/main.c
index bea2cd2b0..1a4d51da7 100644
--- a/samples/bluetooth/hci_usb/src/main.c
+++ b/samples/bluetooth/hci_usb/src/main.c
@@ -15,6 +15,7 @@
#include <net/buf.h>
#include <bluetooth/buf.h>
#include <bluetooth/hci_raw.h>
+#include <bluetooth/l2cap.h>
#include "usb_device.h"
#include "usb_common.h"
@@ -74,8 +75,7 @@ static struct device *btusb_dev;
static K_FIFO_DEFINE(rx_queue);
/* HCI command buffers */
-#define CMD_BUF_SIZE (CONFIG_BLUETOOTH_HCI_SEND_RESERVE + \
- sizeof(struct bt_hci_cmd_hdr) + \
+#define CMD_BUF_SIZE (CONFIG_BLUETOOTH_HCI_RESERVE + BT_HCI_CMD_HDR_SIZE + \
CONFIG_BLUETOOTH_MAX_CMD_LEN)
NET_BUF_POOL_DEFINE(tx_pool, CONFIG_BLUETOOTH_HCI_CMD_COUNT, CMD_BUF_SIZE,
@@ -83,10 +83,8 @@ NET_BUF_POOL_DEFINE(tx_pool, CONFIG_BLUETOOTH_HCI_CMD_COUNT, CMD_BUF_SIZE,
#define BT_L2CAP_MTU 64
/** Data size needed for ACL buffers */
-#define BT_BUF_ACL_SIZE (CONFIG_BLUETOOTH_HCI_RECV_RESERVE + \
- sizeof(struct bt_hci_acl_hdr) + \
- 4 /* L2CAP header size */ + \
- BT_L2CAP_MTU)
+#define BT_BUF_ACL_SIZE (CONFIG_BLUETOOTH_HCI_RESERVE + BT_HCI_ACL_HDR_SIZE + \
+ BT_L2CAP_HDR_SIZE + BT_L2CAP_MTU)
NET_BUF_POOL_DEFINE(acl_tx_pool, 2, BT_BUF_ACL_SIZE, sizeof(uint8_t), NULL);