Repository navigation
Stop scanning before connecting a Bluetooth sensor on Linux - #84
Merged
Merged
Conversation
BlueZ often aborts a connection made while the radio is scanning, with le-connection-abort-by-local or Service discovery timed out (#70). Picking a device to add left the scan running for up to 0.6 s, and the search for remembered sensors connected while scanning. On Linux the scan is now stopped first, and the search for remembered sensors connects one at a time and then scans again. macOS and Windows are unchanged.
One connect path for adding a device and for remembered sensors: it counts the connections under way, stops the scan first on Linux, and starts it again once none are left and a search still wants it. Picking a device to add while remembered sensors were being looked for used to connect with the scan still running.
pepperstm
force-pushed
the
fix/linux-ble-connect
branch
from
November 12, 2026 15:43
4d97b02 to
4cd8637
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A Linux user's xoss speed sensor wouldn't connect (#70). BlueZ kept cancelling the connection, with
le-connection-abort-by-localorService discovery timed out. BlueZ often does that to a connection made while the radio is scanning, and VeloPopuli was doing exactly that:Every Bluetooth connection now goes through one path. It counts the connections under way and, on Linux, stops the scan first, then starts it again once none are left and a search still wants it.
macOS and Windows connect fine while scanning, so they're unchanged.
Checked
npm run checkpasses, and CI's Linux build compiles the Linux path.Refs #70