Skip to content

Commit

Permalink
feat(ble): introduce Kconfig option to disable Bluetooth profile adve…
Browse files Browse the repository at this point in the history
…rtising

This is useful for dongle mode with only USB output.
  • Loading branch information
xudongzheng committed Feb 21, 2025
1 parent 40e9e5c commit 51ffa50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ config ZMK_BLE_MOUSE_REPORT_QUEUE_SIZE
config ZMK_BLE_CLEAR_BONDS_ON_START
bool "Configuration that clears all bond information from the keyboard on startup."

config ZMK_BLE_PROFILE_ADVERTISING
bool "Advertise on BLE profiles"
default y

# HID GATT notifications sent this way are *not* picked up by Linux, and possibly others.
config BT_GATT_NOTIFY_MULTIPLE
default n
Expand Down
7 changes: 7 additions & 0 deletions app/src/ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ bool zmk_ble_active_profile_is_connected(void) {
advertising_status = ZMK_ADV_CONN;

int update_advertising(void) {
#if IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
#if !IS_ENABLED(CONFIG_ZMK_BLE_PROFILE_ADVERTISING)
LOG_INF("skipping advertising since profile advertising is disabled");
return 0;
#endif
#endif

int err = 0;
bt_addr_le_t *addr;
struct bt_conn *conn;
Expand Down

0 comments on commit 51ffa50

Please sign in to comment.