umsh_ulcp_runtime/
lib.rs

1//! Board-agnostic ULCP device runtime shared across firmware targets.
2//!
3//! This crate holds the parts of the ULCP device that have no board HAL
4//! dependency, so the nRF52840 (T-Echo / T-1000E) and ESP32-S3 (Heltec V3)
5//! firmwares consume one copy instead of maintaining divergent forks.
6//!
7//! Increment A moved the pure leaf modules: transport arbitration, the
8//! persisted counter map re-export, the BLE pairing-policy helpers, and the
9//! radio multiplexer. Increment C adds [`driver`]: the ULCP session run loop
10//! (formerly the nRF `device_task`/`apply_effect`/`Emitter`), with every board
11//! coupling routed through the [`driver::DeviceEnv`] trait.
12//!
13//! The storage layer followed: [`journal`] holds the two-page rotating
14//! journal handle (mount scan, write-target rotation, boot walk-back) and
15//! [`node_counters`] the device node's persisted frame counters. Both are
16//! generic over the board's flash type, which is the only part of that
17//! stack that is genuinely per-board — the nRF images drive
18//! MPSL-coordinated NVMC, the ESP32 image its SPI part. Shared modules
19//! emit diagnostics through [`log`], whose sink each board installs once
20//! at boot.
21
22#![cfg_attr(not(test), no_std)]
23
24// Pure, dependency-free — always available.
25pub mod ble_security;
26pub mod log;
27pub mod transport_policy;
28
29// Gated so non-radio / non-persistent consumers stay lightweight.
30#[cfg(feature = "counters")]
31pub mod counter_map;
32#[cfg(feature = "device-node")]
33pub mod device_node;
34#[cfg(feature = "driver")]
35pub mod driver;
36#[cfg(feature = "driver")]
37pub mod duty_gate;
38#[cfg(feature = "gnss")]
39pub mod gnss;
40#[cfg(feature = "counters")]
41pub mod journal;
42#[cfg(feature = "counters")]
43pub mod node_counters;
44#[cfg(feature = "radio")]
45pub mod radio_mux;