mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-20 04:55:20 -05:00
feat(ble): Allow disabling BLE BAS reporting
The battery reporting has been known to cause macOS computers to wakeup repeatedly. In some cases (e.g. display or custom lighting implementation) one might want to collect battery SOC without broadcasting over BLE * Update docs/docs/config/battery.md Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
This commit is contained in:
@@ -51,7 +51,7 @@ static int zmk_battery_update(const struct device *battery) {
|
||||
|
||||
if (last_state_of_charge != state_of_charge.val1) {
|
||||
last_state_of_charge = state_of_charge.val1;
|
||||
|
||||
#if IS_ENABLED(CONFIG_BT_BAS)
|
||||
LOG_DBG("Setting BAS GATT battery level to %d.", last_state_of_charge);
|
||||
|
||||
rc = bt_bas_set_battery_level(last_state_of_charge);
|
||||
@@ -60,7 +60,7 @@ static int zmk_battery_update(const struct device *battery) {
|
||||
LOG_WRN("Failed to set BAS GATT battery level (err %d)", rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
#endif
|
||||
rc = ZMK_EVENT_RAISE(new_zmk_battery_state_changed(
|
||||
(struct zmk_battery_state_changed){.state_of_charge = last_state_of_charge}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user