Skip to content

Commit

Permalink
samples: bluetooth: central_iso: demonstrate BN > 1
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
fgrandel committed May 31, 2024
1 parent f13e947 commit 5fc6fbf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions samples/bluetooth/central_iso/prj.conf
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion samples/bluetooth/central_iso/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions samples/bluetooth/peripheral_iso/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5fc6fbf

Please sign in to comment.