Skip to content

bluetooth: switch to btleplug#43529

Merged
mrobinson merged 1 commit into
servo:mainfrom
webbeef:btleplug
Mar 23, 2026
Merged

bluetooth: switch to btleplug#43529
mrobinson merged 1 commit into
servo:mainfrom
webbeef:btleplug

Conversation

@webbeef
Copy link
Copy Markdown
Contributor

@webbeef webbeef commented Mar 22, 2026

btleplug depends on tokio so we use a bridge thread to interface with Servo thread based messaging.
We keep feature parity except for BtleplugGATTService::get_includes() that will require upstream implementation.
In terms of OS support, I verified on Linux and MacOS. Android is untested, but btleplug claims support.

Testing: No test failures, green try run at https://github.com/webbeef/servo/actions/runs/23390850825
Fixes: #43254.

@webbeef webbeef requested a review from atbrakhi as a code owner March 22, 2026 00:17
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 22, 2026
@webbeef
Copy link
Copy Markdown
Contributor Author

webbeef commented Mar 22, 2026

The JNI bump in btleplug is discussed here: deviceplug/btleplug#416

Comment thread components/bluetooth/bluetooth.rs Outdated
Comment thread components/bluetooth/bluetooth.rs Outdated
Comment thread components/bluetooth/bluetooth.rs Outdated
Comment thread components/bluetooth/bluetooth.rs Outdated
Comment thread components/bluetooth/bluetooth.rs Outdated
Comment thread components/bluetooth/macros.rs Outdated
Comment thread ports/servoshell/desktop/headed_window.rs
Comment thread components/bluetooth/lib.rs
Comment thread components/bluetooth/lib.rs Outdated
Comment thread components/bluetooth/lib.rs Outdated
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Mar 22, 2026
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 22, 2026
@webbeef webbeef force-pushed the btleplug branch 3 times, most recently from 3509354 to 134781b Compare March 23, 2026 15:39
@sagudev sagudev added this pull request to the merge queue Mar 23, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 23, 2026
@mrobinson mrobinson removed this pull request from the merge queue due to a manual request Mar 23, 2026
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 23, 2026
btleplug depends on tokio so we use a bridge thread to
interface with Servo thread based messaging.
We keep feature parity except for BtleplugGATTService::get_includes()
that will require upstream support.

Signed-off-by: webbeef <me@webbeef.org>
@mrobinson mrobinson enabled auto-merge March 23, 2026 16:49
@mrobinson mrobinson added this pull request to the merge queue Mar 23, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 23, 2026
Merged via the queue into servo:main with commit ae78fbb Mar 23, 2026
30 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 23, 2026
@qdot
Copy link
Copy Markdown
Contributor

qdot commented Apr 20, 2026

Wait. Servo is using btleplug? If so, we can prioritize our jni upgrade.

@webbeef
Copy link
Copy Markdown
Contributor Author

webbeef commented Apr 20, 2026

Wait. Servo is using btleplug? If so, we can prioritize our jni upgrade.

That would be wonderful. Because just bumping the version number is not enough 🥲

@qdot
Copy link
Copy Markdown
Contributor

qdot commented Apr 27, 2026

@webbeef Ok, well, deviceplug/btleplug#462 passes all of our embedded device tests for android. I've got a lot more testing to do on it in our applications before it lands, and there's also some policy questions around Servo AI code acceptance (even though this is a dependency). This upgrade wasn't happening without sort sort of help (no one on the project knows how the JNI works, see https://nonpolynomial.com/2023/10/30/how-to-beg-borrow-steal-your-way-to-a-cross-platform-bluetooth-le-library/, and no one has touched it since it originally came in, hence the 5 years out of date library), so that may need to be reckoned with.

@sagudev
Copy link
Copy Markdown
Member

sagudev commented Apr 27, 2026

there's also some policy questions around Servo AI code acceptance (even though this is a dependency)

We already use wgpu, vello, and some mozilla stuff and they all allow use of AI, so this should be no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explore porting the WebBluetooth support to btleplug

5 participants