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 <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2024-05-10 18:48:09 +02:00 committed by Fabio Baltieri
commit cbae5d5f3f
5 changed files with 56 additions and 2 deletions

View file

@ -17,6 +17,7 @@ app=tests/bsim/bluetooth/ll/advx \
conf_overlay=overlay-ticker_expire_info.conf compile
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split.conf compile
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_tx_defer.conf compile
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_privacy.conf compile
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_low_lat.conf compile
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_single_timer.conf compile

View file

@ -0,0 +1,19 @@
CONFIG_BT=y
CONFIG_LOG=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_PRIVACY=y
CONFIG_BT_SMP=y
CONFIG_BT_SIGNING=y
CONFIG_BT_BAS=y
CONFIG_BT_HRS=y
CONFIG_BT_ATT_PREPARE_COUNT=2
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BT_DEVICE_NAME="bsim_test_split"
CONFIG_BT_L2CAP_TX_BUF_COUNT=6
CONFIG_BT_CTLR_PRIVACY=n
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_TX_DEFER=y

View file

@ -60,6 +60,7 @@ static uint8_t connected_signal;
*/
#define WAIT_TIME 6 /*seconds*/
#define WAIT_TIME_TX_DEFER 800 /* milliseconds */
#define WAIT_TIME_REPEAT 22 /*seconds*/
extern enum bst_result_t bst_result;
@ -77,7 +78,11 @@ extern enum bst_result_t bst_result;
static void test_con1_init(void)
{
bst_ticker_set_next_tick_absolute(WAIT_TIME*1e6);
if (IS_ENABLED(CONFIG_BT_CTLR_TX_DEFER)) {
bst_ticker_set_next_tick_absolute(WAIT_TIME_TX_DEFER*1e3);
} else {
bst_ticker_set_next_tick_absolute(WAIT_TIME*1e6);
}
bst_result = In_progress;
}

View file

@ -209,7 +209,11 @@ static void test_con2_main(void)
* of starting delayed work so we do it here
*/
while (1) {
k_sleep(K_SECONDS(1));
if (IS_ENABLED(CONFIG_BT_CTLR_TX_DEFER)) {
k_sleep(K_MSEC(1));
} else {
k_sleep(K_SECONDS(1));
}
/* Heartrate measurements simulation */
hrs_notify();

View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Copyright 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Basic connection test: a central connects to a peripheral and expects a
# notification, using the split controller (ULL LLL)
simulation_id="basic_conn_split_tx_defer"
verbosity_level=2
cd ${BSIM_OUT_PATH}/bin
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_conn_prj_split_tx_defer_conf \
-v=${verbosity_level} -s=${simulation_id} -d=0 -RealEncryption=0 \
-testid=peripheral -rs=23
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_conn_prj_split_tx_defer_conf\
-v=${verbosity_level} -s=${simulation_id} -d=1 -RealEncryption=0 \
-testid=central -rs=6
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=20e6 $@
wait_for_background_jobs