From 8e38b5d09c03f2f9823d7dec6304eaab9b297384 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Fri, 3 Apr 2026 17:23:25 -0600 Subject: [PATCH] docs: add README and LICENSE to Rust client and mux crates --- LICENSE | 21 +++++++++++++++++++++ README.md | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a4ad6f1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Stephen Waits + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..31f2d62 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# DongLoRa Rust Client + +Rust client library for talking to a DongLoRa device — either directly +over USB or through the [mux daemon](../../mux/). + +## What's in Here + +- `src/protocol.rs` — wire protocol types (`RadioConfig`, `Command`, `Response`, `ErrorCode`) +- `src/codec.rs` — COBS framing, frame accumulator +- `src/discovery.rs` — USB VID:PID device discovery +- `src/transport.rs` — serial and mux socket transports +- `src/client.rs` — high-level `Client` with send/recv +- `src/connect.rs` — auto-detection (mux socket, TCP, direct USB) + +## Usage + +```rust +use donglora_client::*; + +let mut client = connect_default()?; +client.ping()?; +client.set_config(RadioConfig::default())?; +client.start_rx()?; + +loop { + if let Some(Response::RxPacket { rssi, snr, payload }) = client.recv()? { + println!("RX rssi={rssi} snr={snr} len={}", payload.len()); + } +} +``` + +## Dependencies + +- `cobs` — COBS framing +- `serialport` — USB serial communication +- `anyhow` — error handling +- `tracing` — logging