blew
blew is a BLE (Bluetooth Low Energy) Rust library focused on enabling
peer-to-peer applications, and was built as the backend for
iroh-ble-transport.
It differs from other libraries in that it implements both Central and
Peripheral modes, and aims to provide support for macOS, iOS, Android, and
Linux. It is also async-only and requires a Tokio runtime.
It also supports opportunistic L2CAP which provides a lower-level socket-type interface that tends to be significantly faster than using GATT for data transfer.
For Tauri users, see the companion crate
tauri-plugin-blew that vastly
simplifies the necessary setup of the Kotlin/JNI glue to enable Android
functionality.
Supported Platforms
| Platform | Backend | Central | Peripheral | L2CAP |
|---|---|---|---|---|
| macOS / iOS | CoreBluetooth (via objc2) |
Yes | Yes | Yes |
| Linux | BlueZ (via bluer) |
Yes | Yes | Yes |
| Android | JNI + Kotlin (via jni and ndk-context) |
Yes | Yes | Yes |
Examples
Alternative Libraries
This library was customized primarily to be used for Iroh, and there are plenty of great alternatives out there! I'm sure I'm missing some, but to name a few that are actively maintained:
License
This project is licensed under the GNU Affero General Public License v3.0 or later.
Commercial licenses are available for use cases where the AGPL is not suitable. Contact me@jakebot.org for details.