Skip to main content

nimble_rs_sys/
lib.rs

1//! Raw FFI bindings to the [esp-nimble](https://github.com/espressif/esp-nimble)
2//! BLE host stack (Espressif's fork of Apache NimBLE).
3//!
4//! The C stack is compiled from source (git submodule) by `build.rs`; its
5//! Mynewt *syscfg* configuration (`MYNEWT_VAL_*`) is driven by this crate's
6//! Cargo features - see `gen/features.rs` for the mapping.
7//!
8//! # Symbols this crate expects from its consumer
9//!
10//! The compiled C code is deliberately OS- and transport-agnostic. The
11//! following symbol families are *declared* here but must be *defined* by the
12//! consuming crate (normally `nimble-rs`):
13//!
14//! - `ble_npl_*` - the NimBLE Porting Layer (OS abstraction: event queues,
15//!   mutexes, semaphores, callouts, time, critical sections). The object
16//!   layouts are fixed by `gen/glue/include/nimble/nimble_npl_os.h`.
17//! - `nimble_port_init`/`nimble_port_deinit`/`nimble_port_run`/
18//!   `nimble_port_stop`/`nimble_port_get_dflt_eventq` - the port entry points
19//!   (the C `nimble_port.c` is not compiled; see `gen/builder.rs`).
20//! - `ble_transport_ll_init`/`ble_transport_ll_deinit`/
21//!   `ble_transport_to_ll_cmd_impl`/`ble_transport_to_ll_acl_impl`/
22//!   `ble_transport_to_ll_iso_impl` - the HCI bridge towards the controller.
23//! - `nimble_platform_mem_*` - heap hooks; unreachable with this crate's fixed
24//!   `BLE_STATIC_TO_DYNAMIC=0` configuration, but they must link.
25//! - The usual libc string/memory functions (`memcpy`, `memset`, `strlen`,
26//!   ...) on `no_std` targets without a hosted libc.
27
28#![no_std]
29#![allow(non_upper_case_globals)]
30#![allow(non_camel_case_types)]
31#![allow(non_snake_case)]
32#![allow(unknown_lints)]
33#![allow(rustdoc::all)]
34#![allow(clippy::all)]
35
36include!(env!("NIMBLE_RS_SYS_BINDINGS_FILE"));