Expand description
Safe, async, cross-platform Rust API for the esp-nimble BLE host, running
over any bt-hci controller.
Work in progress - see docs/PLAN.md in the repository root. The overall
architecture:
- The NimBLE C host is compiled by
nimble-rs-sys; its OS layer (NPL) and HCI transport are implemented here, in Rust (npl,hcimodules) - thread-free and allocation-free. Ble::runis the single future that drives everything: the host event loop, the callout timers and the HCI pump. Host API calls may briefly stall the executor while awaiting a command ack from the controller (bounded by the HCI command timeout) - the same latency the C design imposes, just not hidden behind a context switch.
Re-exports§
pub use hci::AdvCmds;pub use hci::CentralCmds;pub use hci::ConnCmds;pub use hci::Controller;pub use hci::CoreCmds;pub use hci::ScanCmds;pub use hci::SmCmds;
Modules§
- gap
- GAP: device name, connection events, and advertising.
- gatt
- GATT: shared types and helpers.
- hci
- The HCI bridge between the NimBLE C host and a
bt-hcicontroller. - mbuf
- Safe interaction with the NimBLE
os_mbufbuffer system.
Macros§
- gatt_
services - Define a static (compile-time, heap-free) GATT service table.
Structs§
- Ble
- The BLE host driver: a singleton wrapping the NimBLE host stack.
- BleAddr
- A BLE device address (type + 6 bytes).
- BleError
- An error code from the NimBLE host (the
BLE_HS_E*namespace), or 0. - Spin
Parker - The universal fallback parker: never sleeps, making the wait loop a busy
poll with a
spin_loophint.
Enums§
- BleUuid
- A BLE UUID, either 16-bit (assigned) or 128-bit (vendor-specific).
- Host
Event - Events of the host stack itself.
Constants§
- CONN_
HANDLE_ NONE - The “no connection” handle: local GATT reads and writes carry this instead of a real connection handle.
Traits§
- Parker
- How a blocked NPL operation sleeps and is woken.
Type Aliases§
- Conn
Handle - A connection handle.