Skip to content

Commit db97c5e

Browse files
committed
tests: Bluetooth: bsim: Add test for auto connection parameter update
Add BabbleSim test to cover the automatic preferred peripheral connection parameter requests across multiple simultaneous connections. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 6340ad1 commit db97c5e

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

tests/bsim/bluetooth/ll/compile.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@ app=tests/bsim/bluetooth/ll/multiple_id compile
4848
app=tests/bsim/bluetooth/ll/throughput compile
4949

5050
app=tests/bsim/bluetooth/ll/conn_param compile
51+
app=tests/bsim/bluetooth/ll/conn_param conf_file=prj-ll_sw_llcp_legacy.conf compile
5152

5253
wait_for_background_jobs
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
CONFIG_BT=y
2+
CONFIG_BT_PERIPHERAL=y
3+
CONFIG_BT_CENTRAL=y
4+
5+
CONFIG_BT_DEVICE_NAME="Zephyr Conn Param"
6+
7+
CONFIG_BT_USER_PHY_UPDATE=y
8+
CONFIG_BT_AUTO_PHY_UPDATE=y
9+
CONFIG_BT_USER_DATA_LEN_UPDATE=y
10+
CONFIG_BT_AUTO_DATA_LEN_UPDATE=y
11+
12+
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y
13+
CONFIG_BT_PERIPHERAL_PREF_MIN_INT=41
14+
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=41
15+
CONFIG_BT_PERIPHERAL_PREF_LATENCY=0
16+
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=31
17+
18+
CONFIG_BT_CONN_PARAM_UPDATE_TIMEOUT=30000
19+
CONFIG_BT_CONN_PARAM_RETRY_COUNT=10
20+
CONFIG_BT_CONN_PARAM_RETRY_TIMEOUT=1000
21+
22+
CONFIG_BT_MAX_CONN=5
23+
CONFIG_BT_ID_MAX=5
24+
25+
# L2CAP, ATT and SMP may cause data transmission deadlock due to shortage
26+
# of buffers when transactions crossover amongst the connections in the same
27+
# device.
28+
29+
CONFIG_BT_GATT_CLIENT=y
30+
31+
# CONFIG_BT_SMP=y
32+
# CONFIG_BT_MAX_PAIRED=250
33+
# CONFIG_BT_PRIVACY=y
34+
35+
CONFIG_BT_L2CAP_TX_MTU=247
36+
37+
CONFIG_BT_BUF_CMD_TX_SIZE=255
38+
CONFIG_BT_BUF_EVT_RX_SIZE=255
39+
CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255
40+
CONFIG_BT_BUF_ACL_TX_SIZE=251
41+
CONFIG_BT_BUF_ACL_TX_COUNT=5
42+
CONFIG_BT_BUF_ACL_RX_SIZE=251
43+
44+
CONFIG_BT_LL_SW_LLCP_LEGACY=y
45+
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
46+
47+
# Each PHY update can pause connections for 6 interval hence to let other
48+
# parallel connection establishment to succeed increase Rx buffer count.
49+
CONFIG_BT_CTLR_RX_BUFFERS=6
50+
51+
# Provide enough spacing between connections so that multiple peripheral roles
52+
# when connected to a single peer device (peripheral_identity sample) have
53+
# room for window widening and do not overlap with each other in that single
54+
# peer device. This can be tuned based on connection interval and clock
55+
# accuracy, current value here is sufficient for 500ppm at 1 second interval.
56+
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
57+
CONFIG_BT_CTLR_CENTRAL_SPACING=3000
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2018 Oticon A/S
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="conn_param_legacy"
10+
verbosity_level=2
11+
EXECUTE_TIMEOUT=900
12+
13+
cd ${BSIM_OUT_PATH}/bin
14+
15+
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_conn_param_prj-ll_sw_llcp_legacy_conf \
16+
-v=${verbosity_level} -s=${simulation_id} -d=0 -RealEncryption=1 -testid=central
17+
18+
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_conn_param_prj-ll_sw_llcp_legacy_conf \
19+
-v=${verbosity_level} -s=${simulation_id} -d=1 -RealEncryption=1 -testid=peripheral
20+
21+
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
22+
-D=2 -sim_length=1200e6 $@ -argschannel -at=40
23+
24+
wait_for_background_jobs

0 commit comments

Comments
 (0)