You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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)
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.
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"?
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.
Reacted by Jordan Labrosse, 536b8d24, edisno, Håvard Sørbø, Danila Gornushko, Jeff and GRBaset
Activity
qdot commentedon Jun 25, 2020
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. :|
qdot commentedon Sep 20, 2020
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)
qdot commentedon Sep 20, 2020
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.
arlyxiao commentedon Mar 12, 2023
How's this going?
Is this still in progress?
SyedKaz00 commentedon Apr 3, 2023
^^ Any Progress?
ActuallyHappening commentedon Apr 7, 2023
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
adiibanez commentedon Mar 6, 2025
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"?
qdot commentedon Mar 6, 2025
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.