Dverf
Powerful SDR toolkit designed in pure Rust for HackRF One
Supported and tested devices
Examples
Open device
Open usb device as you like with nusb crate
use ;
Tune
Identical interface to libhackrf
device.set_freq.await?;
device.set_sample_rate.await?;
device.set_baseband_filter_bandwidth.await?;
device.set_lna_gain.await?;
device.set_vga_gain.await?;
device.set_transceiver_mode.await?;
Receive
Device implements futures::Stream, so just do what you normally do with async streams
// Returns Option<Result<Vec<Sample>>>
// Just like ordinary async stream
let chunk = device.next.await;
// Do something with the chunk received
Transmit
Device implements futures::Sink for transmitting by pushing chunk of samples into Sink.
Note that you must have precise control over the sample chunk feed to avoid gaps.
device.set_transceiver_mode.await?;
// Cast Device to `&mut impl Sink<...> + Unpin`
// to keep type across `SinkExt` calls
let sink = device.as_sink;
// Feed chunks
for chunk in samples_iter
// Flush when you finish transmitting
sink.flush.await?;
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.