Skip to content

Commit 39eb9f3

Browse files
committed
samples: Bluetooth: df: Enable TX of mutliple CTEs in a per adv event
Since periodic advertising chains are available there is a possibility to send multiple PDUs including CTE in a periodic advertising event. This commit enables such functionality in direction finding transmitter sample. Signed-off-by: Piotr Pryga <[email protected]>
1 parent 2e9f6d0 commit 39eb9f3

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52820.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ CONFIG_BT_CTLR_ADV_PERIODIC=y
88
CONFIG_BT_CTLR_DF=y
99
CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=n
1010
CONFIG_BT_CTLR_DF_SCAN_CTE_RX=n
11+
12+
# Enable chaining of multiple CTEs in periodic advertising
13+
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
14+
CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK=y
15+
CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX=16

samples/bluetooth/direction_finding_connectionless_tx/boards/nrf52833dk_nrf52833.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ CONFIG_BT_CTLR_ADV_PERIODIC=y
88
CONFIG_BT_CTLR_DF=y
99
CONFIG_BT_CTLR_DF_ANT_SWITCH_RX=n
1010
CONFIG_BT_CTLR_DF_SCAN_CTE_RX=n
11+
12+
# Enable chaining of multiple CTEs in periodic advertising
13+
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
14+
CONFIG_BT_CTLR_ADV_SYNC_PDU_BACK2BACK=y
15+
CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX=16

samples/bluetooth/direction_finding_connectionless_tx/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ CONFIG_BT_DEVICE_NAME="DF Connectionless Beacon App"
33

44
CONFIG_BT_EXT_ADV=y
55
CONFIG_BT_PER_ADV=y
6+
CONFIG_BT_BROADCASTER=y
67

78
# Enable Direction Finding Feature including AoA and AoD
89
CONFIG_BT_DF=y

samples/bluetooth/direction_finding_connectionless_tx/src/main.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
/* Length of CTE in unit of 8[us] */
2020
#define CTE_LEN (0x14U)
21+
/* Number of CTE send in single periodic advertising train */
22+
#define PER_ADV_EVENT_CTE_COUNT 5
2123

2224
static void adv_sent_cb(struct bt_le_ext_adv *adv,
2325
struct bt_le_ext_adv_sent_info *info);
@@ -50,19 +52,18 @@ static struct bt_le_per_adv_param per_adv_param = {
5052
static uint8_t ant_patterns[] = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA };
5153
#endif /* CONFIG_BT_CTLR_DF_ANT_SWITCH_TX */
5254

53-
struct bt_df_adv_cte_tx_param cte_params = {
54-
.cte_len = CTE_LEN,
55-
.cte_count = 1,
55+
struct bt_df_adv_cte_tx_param cte_params = { .cte_len = CTE_LEN,
56+
.cte_count = PER_ADV_EVENT_CTE_COUNT,
5657
#if defined(CONFIG_BT_CTLR_DF_ANT_SWITCH_TX)
57-
.cte_type = BT_HCI_LE_AOD_CTE_2US,
58-
.num_ant_ids = ARRAY_SIZE(ant_patterns),
59-
.ant_ids = ant_patterns
58+
.cte_type = BT_HCI_LE_AOD_CTE_2US,
59+
.num_ant_ids = ARRAY_SIZE(ant_patterns),
60+
.ant_ids = ant_patterns
6061
#else
61-
.cte_type = BT_HCI_LE_AOA_CTE,
62-
.num_ant_ids = 0,
63-
.ant_ids = NULL
62+
.cte_type = BT_HCI_LE_AOA_CTE,
63+
.num_ant_ids = 0,
64+
.ant_ids = NULL
6465
#endif /* CONFIG_BT_CTLR_DF_ANT_SWITCH_TX */
65-
};
66+
};
6667

6768
static void adv_sent_cb(struct bt_le_ext_adv *adv,
6869
struct bt_le_ext_adv_sent_info *info)

0 commit comments

Comments
 (0)