Skip to main content

DeviceConfig

Enum DeviceConfig 

Source
pub enum DeviceConfig {}

Trait Implementations§

Source§

impl Clone for DeviceConfig

Source§

fn clone(&self) -> DeviceConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeviceConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromStr for DeviceConfig

Source§

fn from_str(s: &str) -> Result<Self>

Parse device configuration from URL-style string

Supported formats:

  • rtlsdr://[device_index]?freq=<hz>&rate=<hz>&gain=<db|auto>&bias_tee=<bool>
  • soapy://<driver>?freq=<hz>&rate=<hz>&gain=<db|auto>&bias_tee=<bool>
  • pluto://<uri>?freq=<hz>&gain=<db|auto>

For RTL-SDR, if device_index is omitted, it defaults to 0 (first device).

For PlutoSDR, the URI can be:

  • An IP address: pluto://192.168.2.1
  • With ip: prefix: pluto://ip:192.168.2.1
  • USB device: pluto://usb: or pluto:///usb:1.18.5 (use triple slash for URIs with colons/dots)

Frequency and sample rate values support SI suffixes (k/K, M, G):

  • 1090M = 1,090,000,000 Hz
  • 2.4M = 2,400,000 Hz
  • 1090000000 (raw Hz values also supported)
§Examples
use desperado::DeviceConfig;
use std::str::FromStr;

// RTL-SDR with SI suffixes (most convenient)
let config = DeviceConfig::from_str("rtlsdr://0?freq=1090M&rate=2.4M&gain=auto").unwrap();

// RTL-SDR with raw Hz values
let config = DeviceConfig::from_str("rtlsdr://0?freq=1090000000&rate=2400000&gain=auto").unwrap();

// RTL-SDR first available device (implicit device 0)
let config = DeviceConfig::from_str("rtlsdr://?freq=1090M&rate=2.4M&gain=49.6").unwrap();
use desperado::DeviceConfig;
use std::str::FromStr;

// PlutoSDR with IP address
let config = DeviceConfig::from_str("pluto://192.168.2.1?freq=1090M&rate=2.4M&gain=40").unwrap();

// PlutoSDR with explicit ip: prefix
let config = DeviceConfig::from_str("pluto://ip:192.168.2.1?freq=1090M&rate=2.4M&gain=40").unwrap();

// PlutoSDR via USB (use triple slash for USB URIs with version numbers)
let config = DeviceConfig::from_str("pluto:///usb:1.18.5?freq=1090M&rate=2.4M&gain=40").unwrap();
Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

impl PartialEq for DeviceConfig

Source§

fn eq(&self, other: &DeviceConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for DeviceConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.