Skip to content
Permalink
Browse files

usb: bluetooth: l2cap buffer size now configurable

Added check to see if CONFIG_BT_CTLR_TX_BUFFER_SIZE is defined,
and use that as the BT_L2CAP_MTU if that is the case. Otherwise,
use the previously hard coded MTU size (64). This enables users
to configure the MTU, enabling longer transfers.
The fix was inspired by how this is solved in
samples/bluetooth/hci_uart/src/main.c

Tested on nrf52840_pca10056.

Signed-off-by: Dennis Wildmark <dennis.wildmark@assaabloy.com>
  • Loading branch information...
dwildmark authored and jhedberg committed Apr 25, 2019
1 parent 0654c33 commit 791def84b16b019a24ed3c3d566a7f6bb706c7a8
Showing with 5 additions and 0 deletions.
  1. +5 −0 subsys/usb/class/bluetooth.c
@@ -42,7 +42,12 @@ NET_BUF_POOL_DEFINE(tx_pool, CONFIG_BT_HCI_CMD_COUNT, CMD_BUF_SIZE,
#define ACL_BUF_COUNT 4
#endif

#if defined(CONFIG_BT_CTLR_TX_BUFFER_SIZE)
#define BT_L2CAP_MTU (CONFIG_BT_CTLR_TX_BUFFER_SIZE - BT_L2CAP_HDR_SIZE)
#else
#define BT_L2CAP_MTU 64
#endif

/* Data size needed for ACL buffers */
#define BT_BUF_ACL_SIZE BT_L2CAP_BUF_SIZE(BT_L2CAP_MTU)
NET_BUF_POOL_DEFINE(acl_tx_pool, ACL_BUF_COUNT, BT_BUF_ACL_SIZE,

0 comments on commit 791def8

Please sign in to comment.
You can’t perform that action at this time.