From 85cfdad3d80d857990f6deb39d527d69ac5db565 Mon Sep 17 00:00:00 2001 From: Florian Grandel Date: Thu, 30 May 2024 17:37:35 +0200 Subject: [PATCH] samples: bluetooth: central_iso: demonstrate BN > 1 This change increases the max SDU size to twice the available max PDU size which results in a burst number (BN) larger than one. The sample thereby demonstrates that the drift compensation algorithm can deal with BN > 1. Signed-off-by: Florian Grandel --- samples/bluetooth/central_iso/prj.conf | 3 +++ samples/bluetooth/central_iso/src/main.c | 2 +- samples/bluetooth/peripheral_iso/prj.conf | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/samples/bluetooth/central_iso/prj.conf b/samples/bluetooth/central_iso/prj.conf index 81264161a5c4255..dedf36ff65ed761 100644 --- a/samples/bluetooth/central_iso/prj.conf +++ b/samples/bluetooth/central_iso/prj.conf @@ -1,3 +1,6 @@ CONFIG_BT=y +# Max 2 PDUs per SDU (BN = 2) +CONFIG_BT_ISO_TX_MTU=494 + CONFIG_LOG=y CONFIG_BT_ISO_CENTRAL=y diff --git a/samples/bluetooth/central_iso/src/main.c b/samples/bluetooth/central_iso/src/main.c index 6cfed45d504d238..f694f79d4c87c3a 100644 --- a/samples/bluetooth/central_iso/src/main.c +++ b/samples/bluetooth/central_iso/src/main.c @@ -52,7 +52,7 @@ static inline bool is_synchronized(void) static uint32_t seq_num; static int32_t sdu_interval_us; -NET_BUF_POOL_FIXED_DEFINE(tx_pool, 1, BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU), +NET_BUF_POOL_FIXED_DEFINE(tx_pool, 2, BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_TX_MTU), CONFIG_BT_CONN_TX_USER_DATA_SIZE, NULL); static void iso_send_sdu(struct k_work *work); diff --git a/samples/bluetooth/peripheral_iso/prj.conf b/samples/bluetooth/peripheral_iso/prj.conf index a605030ca01c69e..3313faa51cb0e38 100644 --- a/samples/bluetooth/peripheral_iso/prj.conf +++ b/samples/bluetooth/peripheral_iso/prj.conf @@ -2,6 +2,8 @@ CONFIG_BT=y CONFIG_LOG=y CONFIG_BT_DEVICE_NAME="Zephyr ISO server" CONFIG_BT_ISO_PERIPHERAL=y +CONFIG_BT_ISO_RX_BUF_COUNT=2 +CONFIG_BT_ISO_RX_MTU=494 CONFIG_BT_SMP=y CONFIG_BT_KEYS_OVERWRITE_OLDEST=y