libhackrf

Crates.iolibhackrf
lib.rslibhackrf
version0.1.1
created_at2025-02-21 04:55:33.785083+00
updated_at2025-02-22 18:50:47.533019+00
descriptionA modern libhackrf wrapper that supports receiving and transmitting.
homepage
repositoryhttps://github.com/connorslade/libhackrf-rs
max_upload_size
id1563574
size17,190
Connor Slade (connorslade)

documentation

https://docs.rs/libhackrf

README

libhackrf-rs

A modern libhackrf wrapper that supports receiving and transmitting.

Example

See the fm_transmit crate for a more complete example of how to use this library, it allows transmitting and receiving frequency modulated audio signals.

let hackrf = HackRf::open()?;
hackrf.set_sample_rate(2_000_000)?;
hackrf.set_freq(100_000_000)?;
hackrf.set_txvga_gain(16)?;

hackrf.start_tx(
    |_hackrf, buffer, _user| {
        for sample in buffer.iter_mut() {
            *sample = Complex::ZERO;
        }
    },
    (),
)?;

loop { thread::park() }
Commit count: 19

cargo fmt