forked from kofal.net/zmk
feat(bt): Add more experimental tweaks.
* Support auto security upgrade for splits properly. * Disable 2M and legacy LLCP if the experimental Kconfig flag is selected.
This commit is contained in:
committed by
Pete Johanson
parent
96f9031951
commit
63c8c5700a
22
app/Kconfig
22
app/Kconfig
@@ -144,28 +144,32 @@ if ZMK_BLE
|
||||
|
||||
config ZMK_BLE_EXPERIMENTAL_FEATURES
|
||||
bool "Experimental: Enable experimental/advanced BLE settings/features"
|
||||
select ZMK_BLE_PASSKEY_ENTRY
|
||||
select BT_GATT_AUTO_SEC_REQ
|
||||
select BT_SMP_ALLOW_UNAUTH_OVERWRITE
|
||||
imply ZMK_BLE_PASSKEY_ENTRY
|
||||
imply BT_GATT_AUTO_SEC_REQ
|
||||
imply BT_SMP_ALLOW_UNAUTH_OVERWRITE
|
||||
help
|
||||
Enables a combination of settings that are planned to be default in future versions of ZMK.
|
||||
This includes changes to timing on BLE pairing initation, BT Secure Connection passkey entry,
|
||||
and allowing overwrite of keys from previously paired hosts.
|
||||
restores use of the updated/new LLCP implementation, disables 2M PHY support, and allows
|
||||
overwrite of keys from previously paired hosts.
|
||||
|
||||
config ZMK_BLE_PASSKEY_ENTRY
|
||||
bool "Require passkey entry on the keyboard to complete pairing"
|
||||
default n
|
||||
select RING_BUFFER
|
||||
|
||||
choice BT_LL_SW_LLCP_IMPL
|
||||
default BT_LL_SW_LLCP_LEGACY if !ZMK_BLE_EXPERIMENTAL_FEATURES
|
||||
|
||||
endchoice
|
||||
|
||||
config BT_CTLR_PHY_2M
|
||||
default n if ZMK_BLE_EXPERIMENTAL_FEATURES
|
||||
|
||||
# BT_TINYCRYPT_ECC is required for BT_SMP_SC_PAIR_ONLY when using HCI
|
||||
config BT_TINYCRYPT_ECC
|
||||
default y if BT_HCI && !BT_CTLR
|
||||
|
||||
choice BT_LL_SW_LLCP_IMPL
|
||||
default BT_LL_SW_LLCP_LEGACY
|
||||
|
||||
endchoice
|
||||
|
||||
config SYSTEM_WORKQUEUE_STACK_SIZE
|
||||
default 4096 if SOC_RP2040
|
||||
default 2048
|
||||
|
||||
@@ -397,11 +397,13 @@ static void split_central_process_connection(struct bt_conn *conn) {
|
||||
|
||||
LOG_DBG("Current security for connection: %d", bt_conn_get_security(conn));
|
||||
|
||||
#if !IS_ENABLED(CONFIG_BT_GATT_AUTO_SEC_REQ)
|
||||
err = bt_conn_set_security(conn, BT_SECURITY_L2);
|
||||
if (err) {
|
||||
LOG_ERR("Failed to set security (reason %d)", err);
|
||||
return;
|
||||
}
|
||||
#endif // !IS_ENABLED(CONFIG_BT_GATT_AUTO_SEC_REQ)
|
||||
|
||||
struct peripheral_slot *slot = peripheral_slot_for_conn(conn);
|
||||
if (slot == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user