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§
- Default
Device - 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 = valuelines with#comments, and no dependency to read it. - Session
- An attached device plus everything needed to describe it, tap it, and re-open it.
- Session
Link - 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:portendpoint, accepting a bracketed IPv6 literal. - prompt_
index 🔒 - Read a 1-based choice from the terminal.
Nonemeans 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_HOMEwhen it is set.
Type Aliases§
- Frame
Tap - The pcap sink shared by the link wrapper (ULCP frames) and the capture loop (radio frames).