Crate seify_hackrfone

source
Expand description

§HackRF One API

This crate provides a Rust interface to the HackRF One, a popular software-defined radio (SDR) peripheral. It allows for transmitting and receiving radio signals using the HackRF One device in pure Rust.

§Example

use anyhow::Result;
use seify_hackrfone::{Config, HackRf};

fn main() -> Result<()> {
    let radio = HackRf::open_first()?;

    radio.start_rx(&Config {
        vga_db: 0,
        txvga_db: 0,
        lna_db: 0,
        amp_enable: false,
        antenna_enable: false,
        frequency_hz: 915_000_000,
        sample_rate_hz: 2_000_000,
        sample_rate_div: 1,
    })?;

    let mut buf = vec![0u8; 32 * 1024];
    loop {
        radio.read(&mut buf)?;
        // Process samples...
    }
}

§License

This crate is licensed under the MIT License.

Structs§

  • A wrapper around Mode which can be safely shared between threads.
  • Configurable parameters on the hackrf
  • HackRF One software defined radio.
  • Represents an asynchronous receive stream from the HackRF device.
  • A three-part version consisting of major, minor, and sub minor components.

Enums§

  • HackRF One errors.
  • Operating modes of the HackRF One.

Type Aliases§

  • Result type for operations that may return an Error.