Skip to content

Commit 215e355

Browse files
committed
refactor(split): allow central to specify peripheral connection parameters
Fixes #1614
1 parent 89d71ed commit 215e355

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

app/src/split/bluetooth/Kconfig

+15-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ config ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_QUEUE_SIZE
2929
int "Max number of behavior run events to queue to send to the peripheral(s)"
3030
default 5
3131

32+
config ZMK_BLE_SPLIT_PREF_INT
33+
int "Connection interval to use for split central/peripheral connection"
34+
default 6
35+
36+
config ZMK_BLE_SPLIT_PREF_LATENCY
37+
int "Latency to use for split central/peripheral connection"
38+
default 30
39+
40+
config ZMK_BLE_SPLIT_PREF_TIMEOUT
41+
int "Supervision timeout to use for split central/peripheral connection"
42+
default 400
43+
3244
endif # ZMK_SPLIT_ROLE_CENTRAL
3345

3446
if !ZMK_SPLIT_ROLE_CENTRAL
@@ -54,8 +66,9 @@ config BT_MAX_PAIRED
5466
config BT_MAX_CONN
5567
default 1
5668

57-
config BT_PERIPHERAL_PREF_MAX_INT
58-
default 6
69+
# Allow central to specify connection parameters.
70+
config BT_GAP_AUTO_UPDATE_CONN_PARAMS
71+
default n
5972

6073
#!ZMK_SPLIT_ROLE_CENTRAL
6174
endif

app/src/split/bluetooth/central.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,9 @@ static bool split_central_eir_found(struct bt_data *data, void *user_data) {
408408
LOG_ERR("Update phy conn failed (err %d)", err);
409409
}
410410
} else {
411-
param = BT_LE_CONN_PARAM(0x0006, 0x0006, 30, 400);
411+
param = BT_LE_CONN_PARAM(
412+
CONFIG_ZMK_BLE_SPLIT_PREF_INT, CONFIG_ZMK_BLE_SPLIT_PREF_INT,
413+
CONFIG_ZMK_BLE_SPLIT_PREF_LATENCY, CONFIG_ZMK_BLE_SPLIT_PREF_TIMEOUT);
412414

413415
LOG_DBG("Initiating new connnection");
414416

0 commit comments

Comments
 (0)