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:
parent
96f9031951
commit
63c8c5700a
3 changed files with 20 additions and 14 deletions
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) {
|
||||
|
|
|
@ -9,8 +9,8 @@ See [Configuration Overview](index.md) for instructions on how to change these s
|
|||
|
||||
## Kconfig
|
||||
|
||||
| Option | Type | Description | Default |
|
||||
| -------------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- |
|
||||
| `CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES` | bool | 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. | n |
|
||||
| `CONFIG_ZMK_BLE_PASSKEY_ENTRY` | bool | Enable passkey entry during pairing for enhanced security. (Note: After enabling this, you will need to re-pair all previously paired hosts) | n |
|
||||
| `CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION` | bool | Low level setting for GATT subscriptions. Set to `n` to work around an annoying Windows bug with battery notifications. | y |
|
||||
| Option | Type | Description | Default |
|
||||
| -------------------------------------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| `CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES` | bool | 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, restores use of the updated/new LLCP implementation, disables 2M PHY support, and allows overwrite of keys from previously paired hosts. | n |
|
||||
| `CONFIG_ZMK_BLE_PASSKEY_ENTRY` | bool | Enable passkey entry during pairing for enhanced security. (Note: After enabling this, you will need to re-pair all previously paired hosts) | n |
|
||||
| `CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION` | bool | Low level setting for GATT subscriptions. Set to `n` to work around an annoying Windows bug with battery notifications. | y |
|
||||
|
|
Loading…
Add table
Reference in a new issue