Skip to content

Commit 8f695da

Browse files
Bluetooth: Controller: Fix DF for per adv chains scanning
This updates DF to properly receive CTE in per adv chains scanning. Signed-off-by: Andrzej Kaczmarek <[email protected]>
1 parent 001d902 commit 8f695da

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

samples/bluetooth/direction_finding_connectionless_rx/boards/nrf52833dk_nrf52833.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ CONFIG_BT_CTLR_DF=y
1010
# Disable Direction Fiding TX mode
1111
CONFIG_BT_CTLR_DF_ANT_SWITCH_TX=n
1212
CONFIG_BT_CTLR_DF_ADV_CTE_TX=n
13+
14+
CONFIG_BT_CTLR_DF_PER_SCAN_CTE_NUM_MAX=16

subsys/bluetooth/controller/Kconfig.df

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ config BT_CTLR_DF_PER_ADV_CTE_NUM_MAX
163163
periodic advertising chain. The range is taken from BT Core spec 5.1, Vol 4 Part E
164164
section 7.8.82 HCI_LE_Set_Connectionless_IQ_Sampling_Enable Max_Sampled_CTEs parameter.
165165

166+
config BT_CTLR_DF_PER_SCAN_CTE_NUM_MAX
167+
int "Maximum number of received PDUs with Constant Tone Extension in connectionless mode"
168+
depends on BT_CTLR_DF_SCAN_CTE_RX
169+
range 1 16
170+
default 16
171+
help
172+
Maximum supported number of PDUs, that have Constant Tone Extension, received in single
173+
periodic advertising chain. The range is taken from BT Core spec 5.1, Vol 4 Part E
174+
section 7.8.82 HCI_LE_Set_Connectionless_IQ_Sampling_Enable Max_Sampled_CTEs parameter.
175+
166176
config BT_CTLR_DF_DEBUG_ENABLE
167177
bool "Bluetooth Direction Finding debug support enable"
168178
help

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -687,11 +687,6 @@ void ll_reset(void)
687687
LL_ASSERT(!err);
688688
#endif /* CONFIG_BT_CTLR_ADV_ISO */
689689

690-
#if defined(CONFIG_BT_CTLR_DF)
691-
err = ull_df_reset();
692-
LL_ASSERT(!err);
693-
#endif
694-
695690
#if defined(CONFIG_BT_CONN)
696691
#if defined(CONFIG_BT_CENTRAL)
697692
/* Reset initiator */
@@ -800,6 +795,15 @@ void ll_reset(void)
800795
/* Common to init and reset */
801796
err = init_reset();
802797
LL_ASSERT(!err);
798+
799+
#if defined(CONFIG_BT_CTLR_DF)
800+
/* Direction Finding has to be reset after ull init_reset call because
801+
* it uses mem_link_rx for node_rx_iq_report. The mem_linx_rx is reset
802+
* in common ull init_reset.
803+
*/
804+
err = ull_df_reset();
805+
LL_ASSERT(!err);
806+
#endif
803807
}
804808

805809
/**

subsys/bluetooth/controller/ll_sw/ull_df_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ enum df_switch_sample_support {
2727
* - for LLL -> ULL
2828
* - for ULL -> LL(HCI).
2929
*/
30-
#if defined(CONFIG_BT_PER_ADV_SYNC_MAX)
31-
#define IQ_REPORT_CNT (CONFIG_BT_PER_ADV_SYNC_MAX * 2)
30+
#if defined(CONFIG_BT_PER_ADV_SYNC_MAX) && defined(CONFIG_BT_CTLR_DF_PER_SCAN_CTE_NUM_MAX)
31+
#define IQ_REPORT_CNT (CONFIG_BT_PER_ADV_SYNC_MAX * CONFIG_BT_CTLR_DF_PER_SCAN_CTE_NUM_MAX * 2)
3232
#else
3333
#define IQ_REPORT_CNT 0
3434
#endif

0 commit comments

Comments
 (0)