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

Add BAS GATT reporting #306

Merged
merged 4 commits into from
Nov 2, 2020
Merged

Add BAS GATT reporting #306

merged 4 commits into from
Nov 2, 2020

Conversation

Nicell
Copy link
Member

@Nicell Nicell commented Oct 27, 2020

This adds BAS GATT reporting using any device binding with the label BATTERY. Closes #47.

Notes:

  • bt_gatt_bas_set_battery_level has been renamed in Zephyr 2.4.0 -> Upgrade to Zephyr 2.4.0 #223
  • zmk_battery_update should eventually raise a battery event instead of directly posting to the BAS GATT
  • If the board doesn't have a battery reporting device, init will fail and none of the timers will run. Should this be behind a Kconfig value instead?
  • I'm thinking that the update function should only update if the battery value has changed since last time. This would for example save from an unnecessary ePaper display refresh in the future.

@Nicell Nicell added bluetooth Bluetooth related items enhancement New feature or request core Core functionality/behavior of ZMK labels Oct 27, 2020
@Nicell Nicell requested a review from petejohanson October 27, 2020 20:17
Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two super minor comments.

app/src/battery.c Show resolved Hide resolved
app/src/battery.c Outdated Show resolved Hide resolved
Co-authored-by: Pete Johanson <peter@peterjohanson.com>
Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@petejohanson petejohanson merged commit 89b8bfc into zmkfirmware:main Nov 2, 2020
@Katona
Copy link
Contributor

Katona commented Mar 4, 2022

Hi! Would it be possible to report the battery level of both halves in case of split keyboards? Either through the "master" (maybe with pressing some combo) or directly to the host via Bluetooth (if it's possible at all)?

@pjeroff
Copy link

pjeroff commented Mar 17, 2023

Hi! Would it be possible to report the battery level of both halves in case of split keyboards? Either through the "master" (maybe with pressing some combo) or directly to the host via Bluetooth (if it's possible at all)?

From what I've seen, Kinesis did something with their new Advantage360 Pro (the BT version) where a combo of keys lights up the LED's to display battery levels on each half...and they run on a custom ZMK firmware, so I'm guessing that's possible.

Reading the docs however, it's currently un-supported https://zmk.dev/docs/features/battery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bluetooth Bluetooth related items core Core functionality/behavior of ZMK enhancement New feature or request hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Proper battery reporting via BLE battery service
4 participants