trouble icon indicating copy to clipboard operation
trouble copied to clipboard

An Rust host BLE stack with a future goal of qualification. Currently the focus is on implementing the host on top of a HCI interface.

trouble

CI

WIP Basic functionality works, but API is likely to change a bit. Use nrf-softdevice for the time being if you want a production ready BLE Rust stack for nRF.

TrouBLE is a Bluetooth Low Energy (BLE) Host implementation written in Rust, with a future goal of qualification.

The initial implementation was based on bleps but has been adopted to work with bt-hci, which implements Rust types for the HCI specification as well as an interface for a BLE Controller.

HCI what?

The BLE specification defines the software of a BLE implementation in terms of a controller (lower layer) and a host (upper layer). These communicate via a standardized protocol called the Host-Controller Interface (HCI), which can operate over different transports such as UART, USB or a custom IPC implementation.

Current status

The implementation has some basic functionality working:

  • Peripheral role - advertise as a peripheral and accept connections.
  • Central role - scan for devices and establish connections.
  • Basic GATT server supporting write, read, notifications
  • L2CAP CoC (Connection oriented Channels) with credit management (for both central and peripheral)
  • Runs on any transport supporting the bt-hci traits.

Example

See examples for example applications. Currently there are two examples:

  • nrf-sdc for the nRF52 based using the nrf-sdc crate.
  • serial-hci which runs on a PC using a HCI controller attached via a serial port (Such as this Zephyr sample).

License

Trouble is licensed under either of

at your option.