Module connection

Module connection 

Source
Expand description

Finding a device, opening a link to it, and holding the attached session.

Discovery is BLE-only on purpose. Identifying a ULCP device over serial means opening the port and speaking to whatever is behind it, and opening a port has side effects — DTR toggles reset some boards, and a 1200-baud touch is this repository’s own DFU trigger. A bench is full of usbmodem/usbserial devices that are not ULCP radios, so a serial port is used only when the user names one. BLE scanning is passive and filtered to the ULCP GATT service, so it cannot land on a foreign device.

Structs§

DefaultDevice
The device to reach for when the command line names none.
Found
One radio seen during a scan, in the form the chooser and the saved default both work with.
Prefs
Persisted tool preferences. Deliberately tiny: setting = value lines with # comments, and no dependency to read it.
Session
An attached device plus everything needed to describe it, tap it, and re-open it.
SessionLink
A link that copies every ULCP frame into the tap, when one is installed.

Enums§

AnyLink
Every transport this tool can open, as one type, so a REPL can move between them without the session being generic over the link.
Discovery
How a scan result set is resolved into one radio.
Target
A device this tool knows how to reach, in the form it would use to reach it again.

Constants§

DISCOVERY_EXTENSION 🔒
How much longer discovery listens when the first window came up empty (or missed the saved default). Power-conscious boards can straddle a two-second advertising window.
DISCOVERY_WINDOW 🔒
How long general discovery listens before deciding what it found.
MESH_RESPONSE_TIMEOUT 🔒
How long a mesh session waits for one command to come back.

Functions§

admin_counter_path
admin_identity_path
The Ed25519 seed this tool administers devices with, and beside it the frame counters that identity has spent.
attach_config
The RF parameters here only size the driver’s airtime-derived timeouts; an administrative or tethered attach never writes PHY configuration.
attach_tapped 🔒
Attach to a link, wrapping it in the capture tap.
choose
Turn a scan result set into a single target, asking the user when the answer is ambiguous — or, under Discovery::Ask, whenever there is anything to ask about.
config_path
confirm
Ask a yes/no question, defaulting to no.
connect
Open, attach, and name a device in one step.
discover
Find the device to talk to when the command line named none.
format_endpoint
Render a host and port the way the user would type them, bracketing a bare IPv6 literal so the result parses back.
history_path
install_trace
Wire the frame-trace hook to stderr.
merge_found
Fold a later scan’s results into an earlier one, keeping order stable and preferring the fresher name and RSSI.
mesh_attach_config
The attach configuration for a device reached over the mesh.
new_tap
open
Open the transport named by target.
open_ble 🔒
open_serial 🔒
open_tcp 🔒
Open a bridged serial link.
parse_endpoint
Parse a host:port endpoint, accepting a bracketed IPv6 literal.
prompt_index 🔒
Read a 1-based choice from the terminal. None means the user declined (empty line or EOF).
render_found
Print a numbered listing of scan results.
routes_path
Routes learned to the nodes this tool has reached.
scan
Scan for ULCP radios advertising the GATT service.
sort_found
Stable ordering: by name, then by id.
state_dir 🔒
Where the preferences file and the REPL history live. One directory, following XDG_STATE_HOME when it is set.

Type Aliases§

FrameTap
The pcap sink shared by the link wrapper (ULCP frames) and the capture loop (radio frames).