The library crates
bluetooth-bridge is built as a stack of library crates. The bridge binary is the thinnest layer on top; everything else can be used without it.
| Crate | Layer | Use it to |
|---|---|---|
| bluetooth-host | the host stack | scan, advertise, connect, use GATT and pair from Rust, on any controller |
| bluetooth-adv | advertising data | parse advertisements and decode beacons and sensors, with no I/O |
| bluetooth-numbers | assigned numbers | name companies, UUIDs, appearances and AD types |
| bluetooth-mesh-stack | Bluetooth Mesh | provision, configure and control mesh nodes |
| bluetooth-bridge | MQTT bridge | run or embed the bridge itself |
The API documentation covers every public item.
Depending on the crates
Section titled “Depending on the crates”Every crate is on crates.io, with its API on docs.rs:
cargo add bluetooth-hostEvery crate shares the workspace version and is released together. While the project is at 0.x, minor versions may break the API; the changelog says what changed.
Conventions shared by every crate
Section titled “Conventions shared by every crate”- No
unsafe. The workspace lints forbidunsafecode. - No panics on input. Everything parsed from the air or the controller is bounds checked and fuzzed; a malformed packet is an error value, never a panic.
- Adopted, not rewritten. HCI commands and events come from Embassy’s
bt-hci crate, cryptography from
RustCrypto, Ruuvi decoding from
ruuvi-sensor-protocol, and the assigned numbers from the Bluetooth SIG’s own data.