servo/components/bluetooth
Nico Burns deb819f233
Upgrade rustc to 1.83 (#34793)
* Upgrade rustc to 1.83

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix crown (change copied from linked clippy function)

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix named lifetime lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Bump shell.nix

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix non-local impl warnings

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Format with 1.83 formatting changes

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix manual non-local impl

Signed-off-by: Nico Burns <nico@nicoburns.com>

* More fixes for crown

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix tidy

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix needless_return lints

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix doc comment lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix missing wait lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Allow needless_lifetimes lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* more doc comments

Signed-off-by: Nico Burns <nico@nicoburns.com>

* More needless_returns

Signed-off-by: Nico Burns <nico@nicoburns.com>

* is_empty lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fix needless_lifetime lints

Signed-off-by: Nico Burns <nico@nicoburns.com>

* fix div_ceil lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Allow non-minimal bool

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Non-local impl in constellation

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Missing wait in constellation

Signed-off-by: Nico Burns <nico@nicoburns.com>

* fmt

Signed-off-by: Nico Burns <nico@nicoburns.com>

* remove useless lints table

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Fixup comments

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Allow non-local definition in sandboxing code to simplify feature flagging

Signed-off-by: Nico Burns <nico@nicoburns.com>

* Remove wait calls and allow zombie_processes lint

Signed-off-by: Nico Burns <nico@nicoburns.com>

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
2025-01-01 09:38:28 +00:00
..
adapter.rs clippy: fix warnings in components/bluetooth (#31566) 2024-03-07 23:32:35 +00:00
bluetooth.rs clippy: fix warnings in components/bluetooth (#31566) 2024-03-07 23:32:35 +00:00
Cargo.toml Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
empty.rs clippy: fix some warnings in desktop and some components (#32583) 2024-06-25 07:04:23 +00:00
lib.rs Upgrade rustc to 1.83 (#34793) 2025-01-01 09:38:28 +00:00
macros.rs fix conditional logic that enables native bluetooth (#31073) 2024-01-12 09:24:39 +00:00
README.md Integrate the devices respository (#30974) 2024-01-09 09:13:41 +00:00
test.rs clippy: fix warnings in components/bluetooth (#31566) 2024-03-07 23:32:35 +00:00

Bluetooth Rust lib using macOS CoreBluetooth

Build Status Crates.io

The main aim of BlurMac is to enable WebBluetooth in Servo on macOS. Thus, API and implementation decisions are affected by the encapsulating Devices, and the sibling BlurZ and BlurDroid crates.

Run Servo with WebBluetooth Enabled

Usually, you don't want to work with BlurMac on its own but use it within Servo. So, most probably you'll want to run Servo with WebBluetooth enabled:

RUST_LOG=blurmac \
./mach run \
    --dev \
    --pref=dom.bluetooth.enabled \
    --pref=dom.permissions.testing.allowed_in_nonsecure_contexts \
    URL

Notes:

  • The above command is actually not really BlurMac-specific (except for the RUST_LOG part). It runs Servo with WBT enabled on any platform where WBT is supported.
  • You don't need the RUST_LOG=blurmac part if you don't want to see BlurMac debug messages on the console.
  • You don't need the --dev part if you want to run a release build.
  • You don't need the --pref=dom.permissions.testing.allowed_in_nonsecure_contexts part if your URL is https (but you do need it if you test a local file).

Known Issues

  • Device RSSI can not be retrieved yet.
  • Support for included services is incomplete.
  • Descriptors are not supported yet.
  • Notifications on characteristics are not supported yet (the limitation comes from Devices).

Compatibility

Tested on:

  • macOS Sierra 10.12.

Licensed under the BSD 3-Clause License.