Skip to content

Commit cbae5d5

Browse files
cvinayakfabiobaltieri
authored andcommitted
tests: bsim: Bluetooth: Deferred ACL Tx transmission setup
Added test to verify deferred ACL Tx transmission setup, such that GATT discovery completes with least latency and GATT notifications can be received earliest after connection establishment. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 2ab1671 commit cbae5d5

File tree

5 files changed

+56
-2
lines changed

5 files changed

+56
-2
lines changed

tests/bsim/bluetooth/ll/compile.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ app=tests/bsim/bluetooth/ll/advx \
1717
conf_overlay=overlay-ticker_expire_info.conf compile
1818

1919
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split.conf compile
20+
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_tx_defer.conf compile
2021
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_privacy.conf compile
2122
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_low_lat.conf compile
2223
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_single_timer.conf compile
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CONFIG_BT=y
2+
CONFIG_LOG=y
3+
CONFIG_BT_CENTRAL=y
4+
CONFIG_BT_PERIPHERAL=y
5+
CONFIG_BT_PRIVACY=y
6+
CONFIG_BT_SMP=y
7+
CONFIG_BT_SIGNING=y
8+
CONFIG_BT_BAS=y
9+
CONFIG_BT_HRS=y
10+
CONFIG_BT_ATT_PREPARE_COUNT=2
11+
CONFIG_BT_GATT_CLIENT=y
12+
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
13+
CONFIG_BT_DEVICE_NAME="bsim_test_split"
14+
CONFIG_BT_L2CAP_TX_BUF_COUNT=6
15+
16+
CONFIG_BT_CTLR_PRIVACY=n
17+
18+
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
19+
CONFIG_BT_CTLR_TX_DEFER=y

tests/bsim/bluetooth/ll/conn/src/test_connect1.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ static uint8_t connected_signal;
6060
*/
6161

6262
#define WAIT_TIME 6 /*seconds*/
63+
#define WAIT_TIME_TX_DEFER 800 /* milliseconds */
6364
#define WAIT_TIME_REPEAT 22 /*seconds*/
6465
extern enum bst_result_t bst_result;
6566

@@ -77,7 +78,11 @@ extern enum bst_result_t bst_result;
7778

7879
static void test_con1_init(void)
7980
{
80-
bst_ticker_set_next_tick_absolute(WAIT_TIME*1e6);
81+
if (IS_ENABLED(CONFIG_BT_CTLR_TX_DEFER)) {
82+
bst_ticker_set_next_tick_absolute(WAIT_TIME_TX_DEFER*1e3);
83+
} else {
84+
bst_ticker_set_next_tick_absolute(WAIT_TIME*1e6);
85+
}
8186
bst_result = In_progress;
8287
}
8388

tests/bsim/bluetooth/ll/conn/src/test_connect2.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ static void test_con2_main(void)
209209
* of starting delayed work so we do it here
210210
*/
211211
while (1) {
212-
k_sleep(K_SECONDS(1));
212+
if (IS_ENABLED(CONFIG_BT_CTLR_TX_DEFER)) {
213+
k_sleep(K_MSEC(1));
214+
} else {
215+
k_sleep(K_SECONDS(1));
216+
}
213217

214218
/* Heartrate measurements simulation */
215219
hrs_notify();
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2024 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
6+
7+
# Basic connection test: a central connects to a peripheral and expects a
8+
# notification, using the split controller (ULL LLL)
9+
simulation_id="basic_conn_split_tx_defer"
10+
verbosity_level=2
11+
12+
cd ${BSIM_OUT_PATH}/bin
13+
14+
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_conn_prj_split_tx_defer_conf \
15+
-v=${verbosity_level} -s=${simulation_id} -d=0 -RealEncryption=0 \
16+
-testid=peripheral -rs=23
17+
18+
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_conn_prj_split_tx_defer_conf\
19+
-v=${verbosity_level} -s=${simulation_id} -d=1 -RealEncryption=0 \
20+
-testid=central -rs=6
21+
22+
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
23+
-D=2 -sim_length=20e6 $@
24+
25+
wait_for_background_jobs

0 commit comments

Comments
 (0)