refactor(ble): Use auto phy/conn for split

This commit is contained in:
Nick Winans 2022-04-14 14:25:43 -05:00 committed by Pete Johanson
parent 13014d3f28
commit 2c7e5b9232
3 changed files with 5 additions and 16 deletions

View file

@ -148,7 +148,7 @@ config BT_PERIPHERAL_PREF_MIN_INT
config BT_PERIPHERAL_PREF_MAX_INT config BT_PERIPHERAL_PREF_MAX_INT
default 12 default 12
config BT_PERIPHERAL_PREF_SLAVE_LATENCY config BT_PERIPHERAL_PREF_LATENCY
default 30 default 30
config BT_PERIPHERAL_PREF_TIMEOUT config BT_PERIPHERAL_PREF_TIMEOUT
@ -175,6 +175,7 @@ menuconfig ZMK_SPLIT_BLE
depends on ZMK_BLE depends on ZMK_BLE
default y default y
select BT_USER_PHY_UPDATE select BT_USER_PHY_UPDATE
select BT_AUTO_PHY_UPDATE
if ZMK_SPLIT_BLE if ZMK_SPLIT_BLE
@ -223,6 +224,9 @@ config BT_MAX_PAIRED
config BT_MAX_CONN config BT_MAX_CONN
default 1 default 1
config BT_PERIPHERAL_PREF_MAX_INT
default 6
#!ZMK_SPLIT_BLE_ROLE_CENTRAL #!ZMK_SPLIT_BLE_ROLE_CENTRAL
endif endif

View file

@ -398,15 +398,6 @@ static void connected(struct bt_conn *conn, uint8_t err) {
LOG_DBG("Connected %s", log_strdup(addr)); LOG_DBG("Connected %s", log_strdup(addr));
err = bt_conn_le_param_update(conn, BT_LE_CONN_PARAM(0x0006, 0x000c, 30, 400));
if (err) {
LOG_WRN("Failed to update LE parameters (err %d)", err);
}
#if IS_SPLIT_PERIPHERAL
bt_conn_le_phy_update(conn, BT_CONN_LE_PHY_PARAM_2M);
#endif
if (bt_conn_set_security(conn, BT_SECURITY_L2)) { if (bt_conn_set_security(conn, BT_SECURITY_L2)) {
LOG_ERR("Failed to set security"); LOG_ERR("Failed to set security");
} }

View file

@ -403,12 +403,6 @@ static bool split_central_eir_found(struct bt_data *data, void *user_data) {
BT_HCI_OP_LE_CREATE_CONN); BT_HCI_OP_LE_CREATE_CONN);
start_scan(); start_scan();
} }
err = bt_conn_le_phy_update(slot->conn, BT_CONN_LE_PHY_PARAM_2M);
if (err) {
LOG_ERR("Update phy conn failed (err %d)", err);
start_scan();
}
} }
return false; return false;