Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to turn off the BLE profile indicator during inactivity #8

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
aa62fd3
feat: handle LED indicators report
bortoz Sep 6, 2022
42cb057
feat: LED indicators displaying
bortoz Sep 6, 2022
9031dd9
docs: add LED indicators documentation
bortoz Sep 6, 2022
10b605e
feat(lighting): Kinesis lighting functionality
ReFil Sep 13, 2022
a981282
Battery life improvements
ReFil Sep 30, 2022
b3322a5
Change default settings
ReFil Oct 7, 2022
7b559b5
fix(lighting): fix initial power on lighting
ReFil Oct 15, 2022
ef1ee7e
Merge remote-tracking branch 'upstream/main' into adv360-z3
ReFil Oct 19, 2022
2e8904e
feat(split): filter known devices on scan
hassa129 Oct 11, 2022
20782cd
fix(bluetooth): Fix ble lights reporting
ReFil Nov 25, 2022
479a6d5
remove undeclared struct warning (#4)
laserscout Jan 12, 2023
1dcda2f
chore(bluetooth): Fix clang formatting
ReFil Jan 12, 2023
af1137e
Merge branch 'main' into adv360-z3
ReFil Jan 12, 2023
566212b
Fix profile 5 behaviour
ReFil Feb 24, 2023
dea3e81
fix(underglow): fix RGB startup
ReFil Apr 27, 2023
715f44e
fix(formatting) fix pre-commit formatting
ReFil Apr 28, 2023
69cfa35
Merge branch 'main' into adv360-z3.2
ReFil Apr 28, 2023
5b396a5
Merge branch 'main' into adv360-z3.2
ReFil May 30, 2023
493537a
fix(zephyr): update new includes
ReFil May 30, 2023
1660750
refactor(ble): Match new kconfigs
ReFil May 30, 2023
1b6af51
fix(formatting): whitespace
ReFil May 30, 2023
2797cc9
refactor(battery): disable BLE battery reporting
ReFil May 30, 2023
d73bd1c
refactor(ble): Match new kconfigs
ReFil May 30, 2023
04443ca
feat: handle LED indicators report
bortoz Sep 6, 2022
7f0f495
refactor: Split endpoint to transport and instance
joelspadin May 14, 2023
4b5ecbc
Fix(leds): Update indicators code
ReFil May 30, 2023
93bf512
Fix broken CI builds on Zephyr 3.2 (#6)
DerDreschner Jul 31, 2023
06023f9
feat(ble): handle BLE disconnection request
cvcore Jul 28, 2023
34a75e3
feat(docs): Add note on modifier functions to macros
caksoylar May 30, 2023
42d2584
feat(docs): Add behavior types section for hold-tap
caksoylar May 30, 2023
5f2d725
feat(docs): Add troubleshooting for Windows issue
caksoylar May 30, 2023
472ce31
feat(docs): Add pointer to Bluetooth page in troubleshooting
caksoylar May 30, 2023
aa14c33
refactor(docs): Move BT troubleshooting items to BT page
caksoylar Jun 3, 2023
48945bd
feat(docs): Note split connectivity improvement with TX power
caksoylar Jun 3, 2023
a74c096
fix(docs): Fix broken link in BT troubleshooting
caksoylar Jun 3, 2023
ec0b1ca
fix(bluetooth): Passkey pairing improvements.
petejohanson Jun 3, 2023
fc5b8e9
fix(boards): Proper i2c pinctrl for BlueMicro840
petejohanson Jun 5, 2023
e93d062
feat(split): allow central to connect to multiple peripherals
xudongzheng Jun 17, 2022
fe52d71
feat(docs): Add an example for combining just modifiers (#1826)
filterpaper Jun 6, 2023
70cc92c
fix(docs): Fix INT6 keycode description
kadoyau Jun 10, 2023
8b60ebf
fix(docs): Change user-setup.md order to agree with order in setup sc…
dixls Jun 11, 2023
92c1692
chore(deps): bump minimatch and serve-handler in /docs
dependabot[bot] Jun 11, 2023
91e520b
chore(deps-dev): bump webpack from 5.80.0 to 5.86.0 in /docs
dependabot[bot] Jun 11, 2023
b471f9a
fix: Enable BT_TINYCRYPT_ECC when using HCI
joelspadin May 14, 2023
0e43d5e
fix(boards): Bump nRF5340 DK I2C buffer size
joelspadin May 14, 2023
296db1d
refactor(sensors): Sensor event channel data, resolution tweaks.
petejohanson Sep 1, 2021
d1974a0
refactor(sensors): ec11 rotation sensor value in degrees.
petejohanson Dec 2, 2021
388e6fc
refactor(config): Select SENSOR as needed.
petejohanson May 26, 2022
0053c79
refactor(bluetooth): Bump HoG stack size.
petejohanson May 22, 2023
2d7e392
refactor(shields): Updated ZMK Uno encoder config.
petejohanson Apr 16, 2023
f1c50e8
refactor(bluetooth): Add battery reporting config.
petejohanson Apr 18, 2023
2598adc
refactor(sensors): Split data handling from triggers.
petejohanson May 4, 2023
c28d96a
refactor(sensors): Use "sensor index" consistently
petejohanson May 17, 2023
f33df73
fix(sensors): Clean ups based on code review.
petejohanson Jun 18, 2023
47da1d1
feat(blog): Add post about sensor refactor.
petejohanson May 30, 2023
656988c
refactor(split): allow central to define connection parameters
xudongzheng May 19, 2023
f055079
feat(behaviors): Support parameterized macros.
petejohanson Apr 8, 2022
611b56d
fix(sensors): Sensor rotate behavior fix for layers.
petejohanson Jun 20, 2023
7abe431
fix(boards): Update pillbug_defconfig to enable pinctrl
kylemccreery Jul 5, 2023
918c6a2
feat(docs): Note that UF2 drive unmounts after flashing (#1859)
filterpaper Jul 6, 2023
6d8ddf4
feat(boards): Leeloo v2 and V2 Zephyr 3.2 fixes
ClicketySplit Jul 17, 2023
5636bc0
fix(docs): Fix README punctuation and add license link
trueNAHO Jul 17, 2023
f83c8c1
feat(nice!view): Custom widgets
Nicell Jul 18, 2023
dfb9b60
fix(displays): Don't enable built-in widget configs by default
Nicell Jul 18, 2023
0e37386
fix: Proper battery sensor Kconfig dependencies.
caksoylar Jul 19, 2023
570b484
fix(docs): Fix typos in parameterized macros docs.
narfdotpl Jul 19, 2023
ba02b2c
chore(deps): bump semver from 5.7.1 to 5.7.2 in /docs
dependabot[bot] Jul 12, 2023
154c5b9
fix(bluetooth): Properly clear peripheral slots
petejohanson Jul 19, 2023
d246536
fix(bluetooth): Corrected use of `bt_addr_le_cmp`
petejohanson Jul 19, 2023
3c117bd
feat: Add more logging to peripheral settings.
petejohanson Jul 20, 2023
575a0c5
fix(bluetooth): Split improvements
petejohanson Jul 21, 2023
6bbbeb9
fix(shields): Make settings_reset more flexible.
petejohanson Jul 21, 2023
44477b1
feat(shields): Add splitkb.com Aurora Sofle
petejohanson Jul 11, 2023
0ce7c57
refactor: use low priority workqueue for underglow and battery reporting
xudongzheng Jul 17, 2023
43dd6ba
refactor(underglow): turn underglow off in low priority work queue
xudongzheng Jul 17, 2023
bd7d5f2
fix(ble): Re enable battery report
ReFil Jul 25, 2023
ca95720
fixing changes
ReFil Aug 4, 2023
2f9e35c
Merge branch 'adv360-z3.2' into adv360-z3.2-beta
cvcore Aug 26, 2023
8af876c
feat(ble): automatically turn off BLE indicator
cvcore Aug 26, 2023
2f7db1a
Update Kconfig
ReFil Sep 20, 2023
e3f56b8
Merge remote-tracking branch 'remotes/upstream/adv360-z3.2-beta' into…
cvcore Sep 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ config ZMK_BLE_PASSKEY_ENTRY
default n
select RING_BUFFER

config ZMK_HANDLE_BLE_DISCONNECTION
bool "Experimental: Respect user disconnection request from computer"
default n

config ZMK_BLE_INDICATOR_AUTO_OFF
bool "Experimental: automatically turn off BLE indicator"
default n

config BT_PERIPHERAL_PREF_MIN_INT
default 6

Expand Down Expand Up @@ -315,6 +323,20 @@ config ZMK_BACKLIGHT_AUTO_OFF_USB
#ZMK_BACKLIGHT
endif

menuconfig ZMK_LED_INDICATORS
bool "LED indicators"
select LED

if ZMK_LED_INDICATORS

config ZMK_LED_INDICATORS_BRT
int "Brightness in percent"
range 1 100
default 80

#ZMK_LED_INDICATORS
endif

#Display/LED Options
endmenu

Expand Down Expand Up @@ -581,4 +603,3 @@ osource "$(ZMK_CONFIG)/boards/shields/*/Kconfig.shield"


source "Kconfig.zephyr"

4 changes: 2 additions & 2 deletions app/boards/arm/corneish_zen/widgets/output_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static void set_status_symbol(lv_obj_t *icon, struct output_status_state state)
if (state.active_profile_bonded) {
if (state.active_profile_connected) {
// sprintf(text, LV_SYMBOL_BLUETOOTH "%i " LV_SYMBOL_OK, active_profile_index);
switch (state.selected_endpoint.ble.profile_index) {
switch (state.selected_endpoint.ble_profile_index) {
case 0:
lv_img_set_src(icon, &bluetooth_connected_1);
break;
Expand All @@ -83,7 +83,7 @@ static void set_status_symbol(lv_obj_t *icon, struct output_status_state state)
lv_img_set_src(icon, &bluetooth_disconnected_right);
}
} else {
switch (state.selected_endpoint.ble.profile_index) {
switch (state.selected_endpoint.ble_profile_index) {
case 0:
lv_img_set_src(icon, &bluetooth_advertising_1);
break;
Expand Down
4 changes: 4 additions & 0 deletions app/include/zmk/ble.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ int zmk_ble_unpair_all();
#if IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
int zmk_ble_put_peripheral_addr(const bt_addr_le_t *addr);
#endif /* IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL) */

#if IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION)
bool ble_seeking_connection();
#endif
16 changes: 16 additions & 0 deletions app/include/zmk/events/led_indicator_changed.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#pragma once

#include <zmk/led_indicators_types.h>
#include <zmk/event_manager.h>

struct zmk_led_changed {
zmk_leds_flags_t leds;
};

ZMK_EVENT_DECLARE(zmk_led_changed);
2 changes: 1 addition & 1 deletion app/src/behaviors/behavior_sensor_rotate_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ int zmk_behavior_sensor_rotate_common_accept_data(
const struct zmk_sensor_channel_data *channel_data);
int zmk_behavior_sensor_rotate_common_process(struct zmk_behavior_binding *binding,
struct zmk_behavior_binding_event event,
enum behavior_sensor_binding_process_mode mode);
enum behavior_sensor_binding_process_mode mode);
92 changes: 83 additions & 9 deletions app/src/ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <zmk/event_manager.h>
#include <zmk/events/ble_active_profile_changed.h>

#if IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION)
#include <zmk/activity.h>
#include <zmk/events/keycode_state_changed.h>
#endif /* IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION) */

#if IS_ENABLED(CONFIG_ZMK_BLE_PASSKEY_ENTRY)
#include <zmk/events/keycode_state_changed.h>

Expand All @@ -62,6 +67,10 @@ enum advertising_type {
static struct zmk_ble_profile profiles[ZMK_BLE_PROFILE_COUNT];
static uint8_t active_profile;

#if IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION)
bool active_profile_seeking_connection = true;
#endif

#define DEVICE_NAME CONFIG_BT_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)

Expand Down Expand Up @@ -97,6 +106,10 @@ bool zmk_ble_active_profile_is_open() {
return !bt_addr_le_cmp(&profiles[active_profile].peer, BT_ADDR_LE_ANY);
}

#if IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION)
bool ble_seeking_connection() { return active_profile_seeking_connection; }
#endif

void set_profile_address(uint8_t index, const bt_addr_le_t *addr) {
char setting_name[15];
char addr_str[BT_ADDR_LE_STR_LEN];
Expand Down Expand Up @@ -167,15 +180,23 @@ int update_advertising() {

if (zmk_ble_active_profile_is_open()) {
desired_adv = ZMK_ADV_CONN;
} else if (!zmk_ble_active_profile_is_connected()) {
desired_adv = ZMK_ADV_CONN;
// Need to fix directed advertising for privacy centrals. See
// https://github.com/zephyrproject-rtos/zephyr/pull/14984 char
// addr_str[BT_ADDR_LE_STR_LEN]; bt_addr_le_to_str(zmk_ble_active_profile_addr(), addr_str,
// sizeof(addr_str));

// LOG_DBG("Directed advertising to %s", addr_str);
// desired_adv = ZMK_ADV_DIR;
} else {
#if IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION)
if (!zmk_ble_active_profile_is_connected() && active_profile_seeking_connection) {
desired_adv = ZMK_ADV_CONN;
}
#else
if (!zmk_ble_active_profile_is_connected()) {
desired_adv = ZMK_ADV_CONN;
// Need to fix directed advertising for privacy centrals. See
// https://github.com/zephyrproject-rtos/zephyr/pull/14984 char
// addr_str[BT_ADDR_LE_STR_LEN]; bt_addr_le_to_str(zmk_ble_active_profile_addr(),
// addr_str, sizeof(addr_str));

// LOG_DBG("Directed advertising to %s", addr_str);
// desired_adv = ZMK_ADV_DIR;
}
#endif /* IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION) */
}
LOG_DBG("advertising from %d to %d", advertising_status, desired_adv);

Expand Down Expand Up @@ -262,6 +283,9 @@ int zmk_ble_prof_select(uint8_t index) {
active_profile = index;
ble_save_profile();

#if IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION)
active_profile_seeking_connection = true;
#endif
update_advertising();

raise_profile_changed_event();
Expand Down Expand Up @@ -431,6 +455,9 @@ static void connected(struct bt_conn *conn, uint8_t err) {
update_advertising();

if (is_conn_active_profile(conn)) {
#if IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION)
active_profile_seeking_connection = false;
#endif
LOG_DBG("Active profile connected");
k_work_submit(&raise_profile_changed_event_work);
}
Expand Down Expand Up @@ -624,6 +651,22 @@ static int zmk_ble_init(const struct device *_arg) {
char setting_name[15];
sprintf(setting_name, "ble/profiles/%d", i);

err = settings_delete(setting_name);
if (err) {
LOG_ERR("Failed to delete setting: %d", err);
}
err = settings_delete("ble/peripheral_address");
if (err) {
LOG_ERR("Failed to delete setting: %d", err);
}
}

// Hardcoding a reasonable hardcoded value of peripheral addresses
// to clear so we properly clear a split central as well.
for (int i = 0; i < 8; i++) {
char setting_name[32];
sprintf(setting_name, "ble/peripheral_addresses/%d", i);

err = settings_delete(setting_name);
if (err) {
LOG_ERR("Failed to delete setting: %d", err);
Expand Down Expand Up @@ -710,6 +753,23 @@ static int zmk_ble_handle_key_user(struct zmk_keycode_state_changed *event) {
return ZMK_EV_EVENT_BUBBLE;
}

if (ring_buf_space_get(&passkey_entries) <= 0) {
uint8_t discard_val;
ring_buf_get(&passkey_entries, &discard_val, 1);
}
ring_buf_put(&passkey_entries, &val, 1);
LOG_DBG("value entered: %d, digits collected so far: %d", val,
ring_buf_size_get(&passkey_entries));

uint8_t val;
if (!(zmk_ble_numeric_usage_to_value(key, HID_USAGE_KEY_KEYBOARD_1_AND_EXCLAMATION,
HID_USAGE_KEY_KEYBOARD_0_AND_RIGHT_PARENTHESIS, &val) ||
zmk_ble_numeric_usage_to_value(key, HID_USAGE_KEY_KEYPAD_1_AND_END,
HID_USAGE_KEY_KEYPAD_0_AND_INSERT, &val))) {
LOG_DBG("Key not a number, ignoring");
return ZMK_EV_EVENT_BUBBLE;
}

if (ring_buf_space_get(&passkey_entries) <= 0) {
uint8_t discard_val;
ring_buf_get(&passkey_entries, &discard_val, 1);
Expand Down Expand Up @@ -737,4 +797,18 @@ ZMK_LISTENER(zmk_ble, zmk_ble_listener);
ZMK_SUBSCRIPTION(zmk_ble, zmk_keycode_state_changed);
#endif /* IS_ENABLED(CONFIG_ZMK_BLE_PASSKEY_ENTRY) */

#if IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION)
/* Restart BLE advertsing after user key press */
static int ble_keypress_listener(const zmk_event_t *eh) {
if (as_zmk_keycode_state_changed(eh) != NULL && !active_profile_seeking_connection &&
!zmk_ble_active_profile_is_connected()) {
active_profile_seeking_connection = true;
k_work_submit(&update_advertising_work);
}
return 0;
}
ZMK_LISTENER(ble_keypress, ble_keypress_listener);
ZMK_SUBSCRIPTION(ble_keypress, zmk_keycode_state_changed);
#endif /* IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION) */

SYS_INIT(zmk_ble_init, APPLICATION, CONFIG_ZMK_BLE_INIT_PRIORITY);
10 changes: 10 additions & 0 deletions app/src/events/led_indicator_changed.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <zephyr/kernel.h>
#include <zmk/events/led_indicator_changed.h>

ZMK_EVENT_IMPL(zmk_led_changed);
60 changes: 56 additions & 4 deletions app/src/rgb_underglow.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,14 @@ static struct rgb_underglow_state state;
static struct zmk_periph_led led_data;

#if IS_ENABLED(CONFIG_ZMK_SPLIT_BLE)
static bool last_ble_state[2];
#endif

static bool last_ble_state[3];

#if IS_ENABLED(CONFIG_ZMK_BLE_INDICATOR_AUTO_OFF)
bool reset_auto_off_counter = true;
#endif /* CONFIG_ZMK_BLE_INDICATOR_AUTO_OFF */

#endif /* CONFIG_ZMK_SPLIT_BLE */

static bool triggered;

Expand Down Expand Up @@ -261,6 +267,9 @@ static void zmk_rgb_underglow_effect_kinesis() {
}
// blink second led slowly if bluetooth not paired, quickly if not connected
if (zmk_ble_active_profile_is_open()) {
#if IS_ENABLED(CONFIG_ZMK_BLE_INDICATOR_AUTO_OFF)
reset_auto_off_counter = true;
#endif
pixels[1].r = pixels[1].r * last_ble_state[0];
pixels[1].g = pixels[1].g * last_ble_state[0];
pixels[1].b = pixels[1].b * last_ble_state[0];
Expand All @@ -270,6 +279,27 @@ static void zmk_rgb_underglow_effect_kinesis() {
}
state.animation_step++;
} else if (!zmk_ble_active_profile_is_connected()) {
#if IS_ENABLED(CONFIG_ZMK_BLE_INDICATOR_AUTO_OFF)
reset_auto_off_counter = true;
#endif

#if IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION)
/* only blink the led when BLE is advertising for connection */
if (ble_seeking_connection()) {
pixels[1].r = pixels[1].r * last_ble_state[1];
pixels[1].g = pixels[1].g * last_ble_state[1];
pixels[1].b = pixels[1].b * last_ble_state[1];
if (state.animation_step > 14) {
last_ble_state[1] = !last_ble_state[1];
state.animation_step = 0;
}
state.animation_step++;
} else {
pixels[1].r = 0;
pixels[1].g = 0;
pixels[1].b = 0;
}
#else /* IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION) */
pixels[1].r = pixels[1].r * last_ble_state[1];
pixels[1].g = pixels[1].g * last_ble_state[1];
pixels[1].b = pixels[1].b * last_ble_state[1];
Expand All @@ -278,7 +308,29 @@ static void zmk_rgb_underglow_effect_kinesis() {
state.animation_step = 0;
}
state.animation_step++;
#endif /* IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION) */
}
#if IS_ENABLED(CONFIG_ZMK_BLE_INDICATOR_AUTO_OFF)
else { // ble is connected
if (led_data.layer == 3) { // when mod key is pressed,
// show current BLE profile for few seconds and then off
reset_auto_off_counter = true;
}
if (reset_auto_off_counter) {
state.animation_step = 0;
last_ble_state[2] = true;
reset_auto_off_counter = false;
}
pixels[1].r = pixels[1].r * last_ble_state[2];
pixels[1].g = pixels[1].g * last_ble_state[2];
pixels[1].b = pixels[1].b * last_ble_state[2];
if (state.animation_step > 84) {
last_ble_state[2] = false;
} else {
state.animation_step++;
}
}
#endif /* IS_ENABLED(CONFIG_ZMK_HANDLE_BLE_DISCONNECTION) */
// set third led as layer state
switch (led_data.layer) {
case 0:
Expand Down Expand Up @@ -330,7 +382,7 @@ static void zmk_rgb_underglow_effect_kinesis() {
if (old_led_data.layer != led_data.layer || old_led_data.indicators != led_data.indicators) {
zmk_rgb_underglow_central_send();
}
#else
#else /* ZMK_BLE_IS_CENTRAL */
#if IS_ENABLED(CONFIG_ZMK_SPLIT_BLE)
// leds for peripheral(right) side
/* if (zmk_ble_active_profile_is_open()) {
Expand Down Expand Up @@ -431,7 +483,7 @@ static void zmk_rgb_underglow_effect_kinesis() {
#if IS_ENABLED(CONFIG_ZMK_SPLIT_BLE)
}
#endif
#endif
#endif /* ZMK_BLE_IS_CENTRAL */
}

static void zmk_rgb_underglow_effect_test() {
Expand Down
7 changes: 6 additions & 1 deletion app/src/split/bluetooth/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ config BT_MAX_CONN
config BT_GAP_AUTO_UPDATE_CONN_PARAMS
default n

config BT_PRIVACY
default y

#!ZMK_SPLIT_ROLE_CENTRAL
endif

Expand All @@ -108,6 +111,9 @@ config BT_MAX_CONN
config BT_MAX_PAIRED
default 6

config BT_FILTER_ACCEPT_LIST
default y

#ZMK_SPLIT_BLE && ZMK_SPLIT_ROLE_CENTRAL
endif

Expand All @@ -124,4 +130,3 @@ endif

#ZMK_BLE
endif

4 changes: 4 additions & 0 deletions app/src/split/bluetooth/central.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ static int start_scanning(void);

#define POSITION_STATE_DATA_LEN 16

#define BT_LE_SCAN_PASSIVE_FILTER \
BT_LE_SCAN_PARAM(BT_LE_SCAN_TYPE_PASSIVE, BT_LE_SCAN_OPT_FILTER_ACCEPT_LIST, \
BT_GAP_SCAN_FAST_INTERVAL, BT_GAP_SCAN_FAST_WINDOW)

enum peripheral_slot_state {
PERIPHERAL_SLOT_STATE_OPEN,
PERIPHERAL_SLOT_STATE_CONNECTING,
Expand Down
Loading