- Add ping-on-connect handshake: all connect functions validate the device within 200ms, rejecting non-DongLoRa serial devices immediately - Add try_connect() — non-blocking connect that errors instead of blocking forever when no USB device is present - Add payload size validation in transmit() (max 256 bytes) - Add ErrorCode: impl std::error::Error - Fix drain_rx error handling (no longer swallows original error) - Fix repository URL to github.com/donglora/client-rs - Remove wire-level tag constants from top-level re-exports - Add rust-version (MSRV 1.85), homepage, exclude fields to Cargo.toml - Add examples/ping.rs - Allow clippy unwrap/expect in test modules
2.4 KiB
2.4 KiB
Changelog
0.2.0 — 2026-04-07
Features
- Ping-on-connect validation — all connect functions automatically ping the device after connecting and reject non-DongLoRa devices within 200ms. No more accidentally talking LoRa protocol to an Arduino.
try_connect(timeout)— non-blocking alternative toconnect(). Returns an error immediately if no DongLoRa device is found instead of blocking indefinitely.- USB-UART bridge chip fallback —
find_port()now detects boards using CP2102, CH9102, CH340, or FT232R bridge chips (validated via ping). - Payload size validation —
transmit()rejects payloads exceeding 256 bytes with a clear error before hitting the wire. ErrorCodeimplementsstd::error::Error— usable in error chains.
Breaking changes
- Wire-level tag constants (
CMD_TAG_*,RESP_TAG_*,ERROR_INVALID_CONFIG) removed from the top-level re-exports. Access them viadonglora_client::protocol::*if needed. connect()and friends now validate the device on connect. Code that previously connected to non-DongLoRa serial devices will now get an error.
Fixes
- Fixed repository URL in crate metadata.
drain_rxno longer swallows the original error if timeout restore also fails.- Removed dead
firmware/PROTOCOL.mdreference from docs.
0.1.0 — 2026-04-06
Initial release.
Features
- High-level
Client<T>with send/recv and command helpers (ping, set_config, start_rx, stop_rx, transmit, get_config, get_mac, display_on, display_off) - COBS wire framing via
ucobs(matches firmware implementation) - Auto-detection connection: TCP mux, Unix socket mux, direct USB serial
- Bounded RX packet buffering (256 packets, FIFO eviction)
FrameReaderaccumulator for streaming byte sources- USB device discovery by VID:PID with blocking wait
Resilience
- Cross-platform timeout handling:
TimedOut(Windows) andWouldBlock(Linux/macOS) both treated as clean timeouts inread_frame EINTR/Interruptedsignals retried automatically inread_framedrain_rxalways restores the original timeout, even on I/O errors- TCP mux connections use
connect_timeout(bounded by caller's timeout) - Mux sockets set both read and write timeouts
SerialTransporttracks timeout accurately for save/restore- Unexpected unsolicited frames logged via
tracing::warninstead of silently discarded