7274293a04d2ea2d4da0e986398e5d51b1332d7c
The 1.0 mux, running on the Protocol v2 wire format and full §13 multi-client semantics. * Tag-aware dispatch. Each inbound client frame is re-tagged with a mux-allocated device tag; responses are routed back to the original client using the tag mapping. The single-oneshot response slot is gone; multiple clients can have commands in flight concurrently. * Full §13.2 multi-client SET_CONFIG semantics. Tracks the (client, modulation) lock owner and synthesizes OK(APPLIED/MINE), OK(ALREADY_MATCHED/OTHER), or OK(LOCKED_MISMATCH/OTHER) based on lock ownership and parameter match. Lock releases automatically on client disconnect. * TX loopback fan-out (§13.4). On TX_DONE(TRANSMITTED) the mux synthesizes an RX frame with origin = LocalLoopback and sends it to every connected client except the transmitter. * Async ERR(EFRAME) fan-out. If the dongle emits async framing errors (tag = 0), they are broadcast to all clients rather than swallowed. * TagMapper with skip-zero allocation and per-client bulk drop on disconnect. * Per-client TX cache on ClientSession so the loopback fan-out does not need the sender to re-buffer. * 500 ms keepalive cadence matching PROTOCOL.md §3.4 inactivity window (replacing the old 5 s loop).
DongLoRa Mux (Rust)
USB multiplexer daemon — lets multiple applications share one DongLoRa dongle simultaneously.
Install
cargo install donglora-mux
What It Does
- Owns the USB serial connection exclusively
- Exposes a Unix domain socket (and optional TCP) speaking the same COBS-framed protocol
- RxPacket frames broadcast to all connected clients
- StartRx/StopRx reference-counted across clients
- SetConfig locked once set (single client can change freely)
- Single-instance enforcement via file lock (stale sockets auto-cleaned)
- Automatic dongle reconnect on hot-plug
- No panics — enforced by clippy deny lints
Running
donglora-mux # start the mux daemon
donglora-mux --verbose # start with verbose logging
donglora-mux --tcp 5741 --port /dev/ttyACM0 # with options
Depends On
donglora-client— protocol types, COBS framing, device discovery
Languages
Rust
98.4%
Just
1.6%