Expand description
DongLoRa host library — connect, configure, send/receive LoRa packets.
Implements the DongLoRa USB protocol (COBS-framed fixed-size LE).
See the protocol module for wire types and constants.
§Quick start
use donglora_client::*;
let mut client = connect_default()?;
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());
}
}Re-exports§
pub use client::Client;pub use codec::FrameReader;pub use codec::decode_frame;pub use codec::encode_frame;pub use codec::read_frame;pub use connect::connect;pub use connect::connect_default;pub use connect::connect_mux_auto;pub use connect::default_socket_path;pub use connect::try_connect;pub use discovery::USB_PID;pub use discovery::USB_VID;pub use discovery::find_port;pub use discovery::wait_for_device;pub use protocol::Bandwidth;pub use protocol::Command;pub use protocol::ErrorCode;pub use protocol::MAX_PAYLOAD;pub use protocol::PREAMBLE_DEFAULT;pub use protocol::RADIO_CONFIG_SIZE;pub use protocol::RadioConfig;pub use protocol::Response;pub use protocol::TX_POWER_MAX;pub use transport::AnyTransport;pub use transport::MuxTransport;pub use transport::SerialTransport;pub use transport::Transport;pub use connect::mux_connect;pub use connect::mux_tcp_connect;
Modules§
- client
- High-level DongLoRa client.
- codec
- COBS framing: encode/decode frames and accumulate partial reads.
- connect
- Connection auto-detection and mux client helpers.
- discovery
- USB device discovery for DongLoRa dongles.
- protocol
- Wire protocol types and fixed-size little-endian serialization.
- transport
- Transport abstraction for byte-stream connections.