pub struct Device<M: SampleMode = F32Iq> { /* private fields */ }Expand description
Owned device handle with a separately owned receive stream. Dropping the handle does not interrupt an outstanding stream, even if stopped.
Implementations§
Source§impl Device<F32Iq>
impl Device<F32Iq>
Sourcepub fn list() -> impl MaybeFuture<Output = Result<Vec<DeviceDescriptor>>>
pub fn list() -> impl MaybeFuture<Output = Result<Vec<DeviceDescriptor>>>
List visible receivers with the standard Realtek USB IDs, without opening them.
Sourcepub fn builder() -> DeviceBuilder
pub fn builder() -> DeviceBuilder
Start a device builder with default configuration.
Sourcepub fn open() -> impl MaybeFuture<Output = Result<Self>>
pub fn open() -> impl MaybeFuture<Output = Result<Self>>
Open the first visible receiver with default configuration.
Sourcepub fn open_serial(
serial: impl Into<String>,
) -> impl MaybeFuture<Output = Result<Self>>
pub fn open_serial( serial: impl Into<String>, ) -> impl MaybeFuture<Output = Result<Self>>
Open a device by its exact USB serial string.
Source§impl<M: SampleMode> Device<M>
impl<M: SampleMode> Device<M>
Sourcepub fn info(&self) -> &DeviceInfo
pub fn info(&self) -> &DeviceInfo
Immutable device metadata.
Sourcepub fn config(&self) -> &Config<M>
pub fn config(&self) -> &Config<M>
Last successfully applied configuration. A failed/canceled configuration
leaves this snapshot unchanged and requires a complete configure retry.
Sourcepub fn actual_frequency_hz(&self) -> u64
pub fn actual_frequency_hz(&self) -> u64
Last successfully programmed center frequency after divider quantization.
Sourcepub fn actual_sample_rate_hz(&self) -> u32
pub fn actual_sample_rate_hz(&self) -> u32
Last successfully programmed complex sample rate after divider quantization.
Sourcepub fn configure(
&mut self,
config: &Config<M>,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn configure( &mut self, config: &Config<M>, ) -> impl MaybeFuture<Output = Result<()>> + '_
Apply a complete configuration. This also recovers from a failed or canceled
control operation. Controls are serialized; overlapping operations from a
stream return crate::Error::Busy and can be retried.
Queued samples may predate a live configuration change. Stop and restart the stream when the caller needs previously queued samples discarded.
Sourcepub fn set_frequency_hz(
&mut self,
hz: u64,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn set_frequency_hz( &mut self, hz: u64, ) -> impl MaybeFuture<Output = Result<()>> + '_
Tune the center frequency in Hz, preserving other settings.
Sourcepub fn set_sample_rate_hz(
&mut self,
hz: u32,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn set_sample_rate_hz( &mut self, hz: u32, ) -> impl MaybeFuture<Output = Result<()>> + '_
Set complex sample rate, preserving other settings.
Sourcepub fn set_gain(
&mut self,
gain: GainConfig,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn set_gain( &mut self, gain: GainConfig, ) -> impl MaybeFuture<Output = Result<()>> + '_
Change tuner gain policy, preserving other settings.
Sourcepub fn set_correction_ppm(
&mut self,
ppm: i32,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn set_correction_ppm( &mut self, ppm: i32, ) -> impl MaybeFuture<Output = Result<()>> + '_
Correct the sampling clock and reapply tuning with the corrected crystal frequency.
Sourcepub fn set_bias_tee(
&mut self,
enabled: bool,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn set_bias_tee( &mut self, enabled: bool, ) -> impl MaybeFuture<Output = Result<()>> + '_
Enable or disable GPIO 0 bias power, preserving other settings.
Sourcepub fn set_direct_sampling(
&mut self,
mode: DirectSampling,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn set_direct_sampling( &mut self, mode: DirectSampling, ) -> impl MaybeFuture<Output = Result<()>> + '_
Set low-frequency direct sampling policy, preserving other settings.
Sourcepub fn rx_stream(&self) -> Result<RxStream<M>>
pub fn rx_stream(&self) -> Result<RxStream<M>>
Claim the single receive stream. The stream starts only when start is
waited/awaited. Dormant and stopped streams retain the claim until close/drop.
Sourcepub fn shutdown(&mut self) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn shutdown(&mut self) -> impl MaybeFuture<Output = Result<()>> + '_
Stop the hardware and disable RF bias power.
Returns Busy without changing lifecycle while a stream claim is held. Close/drop the stream first. Unpolled shutdown has no effects; once begun, shutdown is terminal, idempotent after success, and retryable on failure or cancellation. All independent cleanup steps are attempted on error.
Final-owner Drop performs the same cleanup best-effort, blocking on native targets and scheduling a background task on WebUSB. Explicit shutdown is required to observe cleanup errors/completion.