From b304eaa29bb1cf23deeca199ef10320cf8489f34 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 3 Sep 2022 07:27:11 +0530 Subject: [PATCH] Bluetooth: Controller: Add Kconfig for experimental AD Data Chaining Add a Kconfig for Advertising Data Chaining in Extended and Periodic Advertising, permitting AD data lengths of upto 1650 bytes. The implementation is experimental and needs further testing. Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/Kconfig | 2 +- subsys/bluetooth/controller/Kconfig.ll_sw_split | 16 ++++++++++++++++ .../bsim_bt/bsim_test_adv_chain/prj.conf | 5 ++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/Kconfig b/subsys/bluetooth/controller/Kconfig index 98d033b4941..a0383332597 100644 --- a/subsys/bluetooth/controller/Kconfig +++ b/subsys/bluetooth/controller/Kconfig @@ -536,7 +536,7 @@ config BT_CTLR_ADV_INTERVAL_MAX config BT_CTLR_ADV_DATA_LEN_MAX int "Maximum Advertising Data Length" depends on BT_BROADCASTER - range 31 191 if BT_LL_SW_SPLIT + range 31 191 if BT_LL_SW_SPLIT && !BT_CTLR_ADV_DATA_CHAIN range 31 1650 help Maximum Extended Advertising Data Length. diff --git a/subsys/bluetooth/controller/Kconfig.ll_sw_split b/subsys/bluetooth/controller/Kconfig.ll_sw_split index 1727d6ab31a..7f24d496251 100644 --- a/subsys/bluetooth/controller/Kconfig.ll_sw_split +++ b/subsys/bluetooth/controller/Kconfig.ll_sw_split @@ -189,6 +189,22 @@ config BT_CTLR_ADV_SYNC_SET help Maximum supported periodic advertising sets. +config BT_CTLR_ADV_DATA_CHAIN + bool "Advertising Data chaining [EXPERIMENTAL]" + select EXPERIMENTAL + help + Enable support for Advertising Data chaining in Extended and + Periodic Advertising. This will allow to have Advertising Data Length + upto 1650 bytes. + + This is experimental and work in progress, does not implement + recombining the AD Data and could return BT_HCI_ERR_PACKET_TOO_LONG + when a chain PDU needs its AD data overflow into a new chain PDU. + I.e. AD data in the last PDU could overflow due to the need to add + Aux Pointer field, and if this overflow bytes plus the next AD data + fragment length could be over 255 bytes needing additional chain PDU. + This is not implemented. + config BT_CTLR_ADV_PDU_LINK # Enables extra space in each advertising PDU to allow linking PDUs. # This is required to enable advertising data trains (i.e. transmission diff --git a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf index 2566981c94c..3e7f11009c2 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf +++ b/tests/bluetooth/bsim_bt/bsim_test_adv_chain/prj.conf @@ -5,6 +5,10 @@ CONFIG_BT_EXT_ADV=y CONFIG_BT_EXT_ADV_MAX_ADV_SET=2 CONFIG_BT_DEVICE_NAME="Broadcaster Multiple" +# Enable Advertising Data chaining in Zephyr Bluetooth LE Controller +CONFIG_BT_CTLR_ADVANCED_FEATURES=y +CONFIG_BT_CTLR_ADV_DATA_CHAIN=y + # Zephyr Bluetooth LE Controller will need to use chain PDUs when AD data # length > 191 bytes # - 31 bytes will use 22 bytes for the default name in this sample plus 9 bytes @@ -18,7 +22,6 @@ CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=1650 # Increase Advertising PDU buffers to number of advertising sets times the # number of chain PDUs per advertising set when using Zephyr Bluetooth LE # Controller -CONFIG_BT_CTLR_ADVANCED_FEATURES=y CONFIG_BT_CTLR_ADV_DATA_BUF_MAX=2 # Maximum Extended Scanning buffer size