git clone https://garage44.eu/jeroen/pinnacle.git.. /bt/src/lib.rs
//! Pinnacle's Bluetooth Low Energy host, as pure state machines: bytes
//! from the controller (H4 framing: a packet-type byte, then an HCI
//! command, ACL data or event) go in through [`Host::receive`], bytes for
//! it come out of [`Host::transmit`], and what happened comes out of
//! [`Host::event`]. Time is a parameter. The same code runs in the
//! `bluetooth` service against the device's controller and in host tests
//! against [`sim`], a simulated controller and the air between several.
//!
//! What it does: finds devices by scanning (their names from the
//! advertising data), advertises this device, connects, and over L2CAP's
//! fixed ATT channel is a GATT client (discovering services and
//! characteristics, reading, writing, subscribing to notifications) and a
//! GATT server (a table of services this device offers: its name, its
//! make, and the Pinnacle card for contacts nearby). It pairs by LE
//! Secure Connections ([`smp`]: a six-digit number compared on both
//! screens, a passkey shown on one and typed on the other where one is a
//! keyboard, or "just works" with a device that has neither), after which the
//! controllers encrypt the link, and a bonded device's link is encrypted
//! again on every connection with the key kept ([`Bond`]); the two hand
//! each other their identity as they pair, so a paired device that moves to
//! a new private address is still known.
#![no_std]
extern crate alloc;
pub mod att;
pub mod gatt;
pub mod hci;
pub mod hogp;
pub mod host;
pub mod sim;
pub mod smp;
pub use gatt::{Characteristic, Service, Uuid};
pub use hci::Address;
pub use host::{Bond, Event, Host};
#[cfg(test)]
mod tests;