Skip to content

Add WASM/WebBluetooth Support #13

Open

Description

@qdot

Not particularly sure how it'll be useful, but its the future, so why not.

Pretty much all of the API redesigns will need to happen before this I'm guessing, as we'll need to figure out how futures will convert and what not. Lots to think about.

Activity

  1. qdot commented on Jun 25, 2020

    @qdot
    ContributorAuthor

    This will basically be a wrapper around wasm_bindings WebSys, which still needs a gecko style WebIDL impl for WebBluetooth written for it.

    Guess who's probably doing that. :|

  2. qdot commented on Sep 20, 2020

    @qdot
    ContributorAuthor

    WebBluetooth IDL support has landed into web-sys, and a WASM implementation is available at https://github.com/buttplugio/buttplug-rs-ffi in the WASM module. This could probably be ported over here at any time (though some web-sys IDL generation fixes are still needed)

  3. qdot commented on Sep 20, 2020

    @qdot
    ContributorAuthor

    BTW, if someone sees this and wants to try to do it, you will most likely want to talk to me first. Getting the lifetimes right for the WASM/JS execution model is tricky.

  4. arlyxiao commented on Mar 12, 2023

    @arlyxiao

    How's this going?
    Is this still in progress?

  5. SyedKaz00 commented on Apr 3, 2023

    @SyedKaz00

    ^^ Any Progress?

  6. ActuallyHappening commented on Apr 7, 2023

    @ActuallyHappening

    Having WASM support would be awesome!

    Since it is not currently supported, I have resorted to using this crate and the web-sys using an even more abstracted API

  7. adiibanez commented on Mar 6, 2025

    @adiibanez

    Hi. I'm currently in the process of integrating btleplug to access ble from elixir via rustler https://hex.pm/packages/rustler_btleplug.
    I'm also using some basic javascript web ble in the frontend; in particular for quick demo purposes.

    Noticed this issue regarding supporting web bluetooth and was wondering what the point is of accessing ble via webassembly instead of rust or javascript? In a typical scenario what would be the scope and target application to integrate a webassembly btleplug library? wasm runtime on "anything"?

  8. qdot commented on Mar 6, 2025

    @qdot
    ContributorAuthor

    Noticed this issue regarding supporting web bluetooth and was wondering what the point is of accessing ble via webassembly instead of rust or javascript? In a typical scenario what would be the scope and target application to integrate a webassembly btleplug library? wasm runtime on "anything"?

    Because sometimes you want to write rust to run on the web. For instance, the library I maintain on top of this crate is written in rust, but can compile to WASM and run on the web as well as on various native desktop/mobile platforms. It gives me one codebase for all platforms. A WASM btleplug will still call into the WebAPIs like WebBluetooth (I wrote the webapi bindings for that), but that will be hidden behind our generalized API.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions