Browse Source

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

xmkb
Nick Winans 3 years ago committed by Pete Johanson
parent
commit
2c7e5b9232
  1. 6
      app/Kconfig
  2. 9
      app/src/ble.c
  3. 6
      app/src/split/bluetooth/central.c

6
app/Kconfig

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

9
app/src/ble.c

@ -398,15 +398,6 @@ static void connected(struct bt_conn *conn, uint8_t err) { @@ -398,15 +398,6 @@ static void connected(struct bt_conn *conn, uint8_t err) {
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)) {
LOG_ERR("Failed to set security");
}

6
app/src/split/bluetooth/central.c

@ -403,12 +403,6 @@ static bool split_central_eir_found(struct bt_data *data, void *user_data) { @@ -403,12 +403,6 @@ static bool split_central_eir_found(struct bt_data *data, void *user_data) {
BT_HCI_OP_LE_CREATE_CONN);
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;

Loading…
Cancel
Save