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, the same vocabulary the provisioning file uses, and no dependency to read it. - Session
- An attached device plus everything needed to describe it, tap it, and re-attach it in the other mode.
- 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.
Functions§
- 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 🔒 - 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.
- 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.
- new_tap
- open
- Open the transport named by
target. - open_
ble 🔒 - open_
serial 🔒 - prompt_
index 🔒 - Read a 1-based choice from the terminal.
Nonemeans the user declined (empty line or EOF). - reattach_
link 🔒 - Attach to an already-wrapped link.
- render_
found - Print a numbered listing of scan results.
- 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).