Skip to main content

Uhd

Struct Uhd 

Source
pub struct Uhd { /* private fields */ }
Expand description

Native Rust USRP B2xx RX device. Clones share hardware and configuration.

Implementations§

Source§

impl Uhd

Source

pub fn probe(args: &Args) -> Result<Vec<Args>, Error>

Discover B2xx devices. index takes precedence over a string serial. Supports channel-zero RX on B200, B210, B200mini, and B205mini.

Source

pub fn open<A: TryInto<Args>>(args: A) -> Result<Self, Error>

Open a B2xx without starting RX. Firmware and FPGA images are embedded.

Source

pub fn shutdown(&self) -> Result<(), Error>

Release the device explicitly after closing all stream claims.

Trait Implementations§

Source§

impl AgcControl for Uhd

Source§

fn agc_available( &self, direction: Direction, channel: usize, ) -> Result<bool, Error>

Return whether automatic gain control is available.
Source§

fn agc_enabled( &self, direction: Direction, channel: usize, ) -> Result<bool, Error>

Return whether automatic gain control is currently enabled.
Source§

fn set_agc_enabled( &self, direction: Direction, channel: usize, enabled: bool, ) -> Result<(), Error>

Enable or disable automatic gain control.
Source§

impl AntennaControl for Uhd

Source§

fn antennas( &self, direction: Direction, channel: usize, ) -> Result<Vec<String>, Error>

Return available antenna port names.
Source§

fn antenna(&self, direction: Direction, channel: usize) -> Result<String, Error>

Return the currently selected antenna port name.
Source§

fn set_antenna( &self, direction: Direction, channel: usize, name: &str, ) -> Result<(), Error>

Select an antenna port by name.
Source§

impl BandwidthControl for Uhd

Source§

fn bandwidth(&self, direction: Direction, channel: usize) -> Result<f64, Error>

Return current channel bandwidth in Hz.
Source§

fn set_bandwidth( &self, direction: Direction, channel: usize, hz: f64, ) -> Result<(), Error>

Set channel bandwidth in Hz.
Source§

fn get_bandwidth_range( &self, direction: Direction, channel: usize, ) -> Result<Range, Error>

Return supported channel bandwidth range in Hz.
Source§

impl Clone for Uhd

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl DcOffsetControl for Uhd

Source§

fn dc_offset_available( &self, direction: Direction, channel: usize, ) -> Result<bool, Error>

Return whether automatic DC offset correction is available.
Source§

fn dc_offset_enabled( &self, direction: Direction, channel: usize, ) -> Result<bool, Error>

Return whether automatic DC offset correction is enabled.
Source§

fn set_dc_offset_enabled( &self, direction: Direction, channel: usize, enabled: bool, ) -> Result<(), Error>

Enable or disable automatic DC offset correction.
Source§

impl DeviceInfo for Uhd

Source§

fn driver(&self) -> Driver

SDR driver.
Source§

fn id(&self) -> Result<String, Error>

Identifier for the device, e.g. its serial.
Source§

fn info(&self) -> Result<Args, Error>

Device info that can be displayed to the user.
Source§

fn num_channels(&self, direction: Direction) -> Result<usize, Error>

Number of supported channels.
Source§

fn full_duplex(&self) -> Result<bool, Error>

Whether this device supports simultaneous reception and transmission.
Source§

impl DynDeviceBackend for Uhd

Source§

fn rx_device(&self) -> Option<&dyn DynRxDevice>

Return RX streaming capability, if the backend exposes it.
Source§

fn antenna_control(&self) -> Option<&dyn AntennaControl>

Return antenna control capability, if the backend exposes it.
Source§

fn agc_control(&self) -> Option<&dyn AgcControl>

Return automatic gain control capability, if the backend exposes it.
Source§

fn gain_control(&self) -> Option<&dyn GainControl>

Return gain control capability, if the backend exposes it.
Source§

fn frequency_control(&self) -> Option<&dyn FrequencyControl>

Return frequency control capability, if the backend exposes it.
Source§

fn sample_rate_control(&self) -> Option<&dyn SampleRateControl>

Return sample-rate control capability, if the backend exposes it.
Source§

fn bandwidth_control(&self) -> Option<&dyn BandwidthControl>

Return bandwidth control capability, if the backend exposes it.
Source§

fn dc_offset_control(&self) -> Option<&dyn DcOffsetControl>

Return DC offset control capability, if the backend exposes it.
Source§

fn tx_device(&self) -> Option<&dyn DynTxDevice>

Return TX streaming capability, if the backend exposes it.
Source§

impl FrequencyControl for Uhd

Source§

fn frequency_range( &self, direction: Direction, channel: usize, ) -> Result<Range, Error>

Return supported overall tuning range in Hz.
Source§

fn frequency(&self, direction: Direction, channel: usize) -> Result<f64, Error>

Return current overall channel frequency in Hz.
Source§

fn set_frequency( &self, direction: Direction, channel: usize, frequency: f64, args: Args, ) -> Result<(), Error>

Set overall channel frequency in Hz with optional driver arguments.
Source§

fn frequency_components( &self, direction: Direction, channel: usize, ) -> Result<Vec<String>, Error>

Return named frequency components for the channel.
Source§

fn component_frequency_range( &self, direction: Direction, channel: usize, name: &str, ) -> Result<Range, Error>

Return supported range in Hz for a named frequency component.
Source§

fn component_frequency( &self, direction: Direction, channel: usize, name: &str, ) -> Result<f64, Error>

Return current frequency in Hz for a named frequency component.
Source§

fn set_component_frequency( &self, direction: Direction, channel: usize, name: &str, frequency: f64, ) -> Result<(), Error>

Set frequency in Hz for a named frequency component.
Source§

impl GainControl for Uhd

Source§

fn gain_elements( &self, direction: Direction, channel: usize, ) -> Result<Vec<String>, Error>

Return named gain elements available for the channel.
Source§

fn gain_range( &self, direction: Direction, channel: usize, ) -> Result<Range, Error>

Return supported overall channel gain range in dB.
Source§

fn gain( &self, direction: Direction, channel: usize, ) -> Result<Option<f64>, Error>

Return overall channel gain in dB, if available.
Source§

fn set_gain( &self, direction: Direction, channel: usize, gain: f64, ) -> Result<(), Error>

Set overall channel gain in dB.
Source§

fn gain_element_range( &self, direction: Direction, channel: usize, name: &str, ) -> Result<Range, Error>

Return supported range in dB for a named gain element.
Source§

fn gain_element( &self, direction: Direction, channel: usize, name: &str, ) -> Result<Option<f64>, Error>

Return a named gain element in dB, if available.
Source§

fn set_gain_element( &self, direction: Direction, channel: usize, name: &str, gain: f64, ) -> Result<(), Error>

Set a named gain element in dB.
Source§

impl RxDevice for Uhd

Source§

type RxStreamer = RxStreamer

RX streamer implementation.
Source§

fn rx_streamer( &self, channels: &[usize], _args: Args, ) -> Result<Self::RxStreamer, Error>

Create an RX streamer.
Source§

impl SampleRateControl for Uhd

Source§

fn sample_rate( &self, direction: Direction, channel: usize, ) -> Result<f64, Error>

Return current sample rate in samples per second.
Source§

fn set_sample_rate( &self, direction: Direction, channel: usize, rate: f64, ) -> Result<(), Error>

Set sample rate in samples per second.
Source§

fn get_sample_rate_range( &self, direction: Direction, channel: usize, ) -> Result<Range, Error>

Return supported sample-rate range in samples per second.
Source§

impl TypedDeviceBackend for Uhd

Source§

fn driver() -> Driver

Driver implemented by this backend.
Source§

fn probe(args: &Args) -> Result<Vec<Args>, Error>

Probe devices matching args.
Source§

fn open(args: &Args) -> Result<Self, Error>

Open a typed device matching args.

Auto Trait Implementations§

§

impl Freeze for Uhd

§

impl RefUnwindSafe for Uhd

§

impl Send for Uhd

§

impl Sync for Uhd

§

impl Unpin for Uhd

§

impl UnsafeUnpin for Uhd

§

impl UnwindSafe for Uhd

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> DynRxDevice for T
where T: RxDevice, <T as RxDevice>::RxStreamer: 'static,

Source§

fn rx_streamer( &self, channels: &[usize], args: Args, ) -> Result<Box<dyn RxStreamer>, Error>

Create a type-erased RX streamer.
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> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.