diff --git a/app/Kconfig b/app/Kconfig index 8c0675e0d68..4791975c8c6 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -194,6 +194,15 @@ config ZMK_BLE_PASSKEY_ENTRY bool "Require passkey entry on the keyboard to complete pairing" select RING_BUFFER +# Modifying Start: Disable BLE HID host advertising for USB dongle receivers. +config ZMK_BLE_DISABLE_HOST_ADV + bool "Disable BLE HID host advertising" + help + Disable BLE HID advertising to host devices while keeping BLE enabled. + This is useful for USB dongle receivers that still need BLE split central + communication with peripherals. +# End of Modifying + config BT_SMP_ALLOW_UNAUTH_OVERWRITE imply ZMK_BLE_PASSKEY_ENTRY diff --git a/app/src/ble.c b/app/src/ble.c index 51b172b9f5f..d5309b2430c 100644 --- a/app/src/ble.c +++ b/app/src/ble.c @@ -180,6 +180,15 @@ int update_advertising(void) { struct bt_conn *conn; enum advertising_type desired_adv = ZMK_ADV_NONE; + /* Modifying Start: Disable BLE HID host advertising for USB dongle receivers. */ + if (IS_ENABLED(CONFIG_ZMK_BLE_DISABLE_HOST_ADV)) { + if (advertising_status != ZMK_ADV_NONE) { + CHECKED_ADV_STOP(); + } + return 0; + } + /* End of Modifying */ + if (zmk_ble_active_profile_is_open()) { desired_adv = ZMK_ADV_CONN; } else if (!zmk_ble_active_profile_is_connected()) {