Expand description
The board-agnostic ULCP session driver (Phase 5, increment C).
This is the extraction of the nRF firmware’s device_task select loop, its
apply_effect radio-effect dispatcher, and the Emitter frame stager —
the one copy of the session-driving logic shared by every device
firmware (T-Echo, T-1000E, Heltec V3). The board personalities that used
to be cfg(feature = "t1000e") forks inside the loop are expressed as
DeviceEnv hooks with no-op defaults, so a new board supplies exactly the
couplings it has and nothing else.
The split of responsibilities:
- This module owns the protocol loop: transport arbitration, frame
handling, radio RX/TX-completion processing, every deferred
Effectarm (save/clear/wipe/provision/PIN/RSSI/battery/drain), asynchronous property publication (DeviceEnv::battery_event), and the device-domain mirror. - The board owns the edges: transport tasks feeding
InEvents and drainingTransportChannels, the radio runner + mux serving the session’s virtual [Channels] bundle, and anDeviceEnvimplementation wiring persistence, entropy, pairing, and indicators to its hardware.
Structs§
- DevDomain
Snapshot - The session’s device-domain tables, mirrored to the board’s device node whenever their generation moves (device-node plan increment 3).
- Device
Runtime - The driver’s
'staticwiring: the channels and control blocks the loop shares with the board’s transport and radio tasks. - OutFrame
- One raw ULCP frame in a transport output queue, stamped with the
session generation that produced it so a displaced session’s frames
are dropped at the transport edge (
transport_policy::generation_checked). - Transport
Channels - The per-transport outbound frame queues, drained by the board’s
transport output tasks.
wiredis the physical-possession transport (USB-CDC or UART),blethe bonded GATT transport — the same pairingtransport_policy::Transportnames.
Enums§
- InEvent
- Framing-free receive path and connection edges into the driver.
- Publish
Event - A device-initiated property publication, yielded by
DeviceEnv::publish_event.
Constants§
- FRAME_
IN_ MAX - Largest raw ULCP frame accepted from a transport.
- FRAME_
OUT_ MAX - Largest ULCP frame the session emits (CMD_STR_RECV around a full-MTU payload).
- IDENTITY_
BLOB_ MAX - Buffer the driver hands
DeviceEnv::sign_identity: a node-identity payload plus its 64-octet detached signature, with room for the descriptive options. - SNAPSHOT_
FALLBACK_ LIMIT - How many older snapshot generations boot will try after the newest one is rejected.
Traits§
- Device
Env - Board couplings of the session driver. Everything the loop needs from
the platform, expressed as one trait so the driver itself stays free
of HAL types and
cfgboard forks. Hooks a board doesn’t have keep their no-op defaults (e.g. only the T-1000E implements the attention indicator and transmit-load hooks today).
Functions§
- device_
identity_ record - Derive a device identity’s public key and its persisted record from a raw Ed25519 secret.
- run
- Drive the ULCP session forever: restore persisted state, then
select over host frames, radio receptions, and transmit completions,
executing every session effect through the board’s
DeviceEnv.
Type Aliases§
- Frame
Buf - One raw ULCP frame moving through the driver.
- Input
Channel - The inbound event channel the board’s tasks feed: every transport
task, and whatever owns the buttons on a board with
CAP_ALERT.