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

avoid unnecessary advertising #2740

Open
7-rate opened this issue Jan 2, 2025 · 2 comments
Open

avoid unnecessary advertising #2740

7-rate opened this issue Jan 2, 2025 · 2 comments

Comments

@7-rate
Copy link

7-rate commented Jan 2, 2025

Problem

The current ble.c appears to keep advertise until pairing is complete.
If there is no BLE bonding and you are using a USB connection.
The keyboard will advertise and a third party may pair to the keyboard without permission.

How to fix it?

Add a Kconfig for the advertising timeout time (for example,
ZMK_BLE_ADVERTISING_TIMEOUT) and stop advertising if no pairing occurs for more than the set number of seconds.

If the user wants to advertise again, they can run the bt behavior again or reboot the device.

@7-rate
Copy link
Author

7-rate commented Jan 2, 2025

Expanding the story a bit.
In this regard, I would like to make the following two suggestions:

  1. creating a behavior to stop advertisement may help more people.

  2. it might be a good idea to consider including an advertise timeout specification between central and peripheral on split keyboards as well.
    One possible use case is when a game is played using only the left hand of the split keyboard, in which case the power consumption of the left hand is high.
    *In the current implementation, if the keyboard cannot be paired with the right hand (PERIPHERAL), the power consumption of the left hand is high because the processing is always running.

@7-rate 7-rate mentioned this issue Jan 2, 2025
5 tasks
@lesshonor
Copy link
Contributor

related: #2546

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants