pub struct Device { /* private fields */ }Expand description
High-level owned HackRF device handle.
Implementations§
Source§impl Device
impl Device
Sourcepub fn list() -> impl MaybeFuture<Output = Result<Vec<DeviceDescriptor>>>
pub fn list() -> impl MaybeFuture<Output = Result<Vec<DeviceDescriptor>>>
List visible normal-mode HackRF devices without claiming them.
Sourcepub fn builder() -> DeviceBuilder
pub fn builder() -> DeviceBuilder
Start building and opening a HackRF.
Sourcepub fn open() -> impl MaybeFuture<Output = Result<Self>>
pub fn open() -> impl MaybeFuture<Output = Result<Self>>
Open and configure the first visible HackRF.
Sourcepub fn open_serial(serial: u128) -> impl MaybeFuture<Output = Result<Self>>
pub fn open_serial(serial: u128) -> impl MaybeFuture<Output = Result<Self>>
Open and configure a HackRF by its exact 128-bit serial.
Sourcepub fn info(&self) -> &DeviceInfo
pub fn info(&self) -> &DeviceInfo
Return metadata collected while opening the device.
Sourcepub fn config(&self) -> &Config
pub fn config(&self) -> &Config
Return the configuration last successfully applied by this driver.
Sourcepub fn configure<'a>(
&'a mut self,
config: &'a Config,
) -> impl MaybeFuture<Output = Result<()>> + 'a
pub fn configure<'a>( &'a mut self, config: &'a Config, ) -> impl MaybeFuture<Output = Result<()>> + 'a
Apply a complete validated RX configuration.
Sourcepub fn set_frequency_hz(
&mut self,
frequency_hz: u64,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn set_frequency_hz( &mut self, frequency_hz: u64, ) -> impl MaybeFuture<Output = Result<()>> + '_
Change the center frequency while stopped or receiving.
Sourcepub fn set_sample_rate_hz(
&mut self,
sample_rate_hz: u32,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn set_sample_rate_hz( &mut self, sample_rate_hz: u32, ) -> impl MaybeFuture<Output = Result<()>> + '_
Change the complex sample rate while stopped or receiving.
The driver also requests a baseband filter bandwidth equal to this rate.
Sourcepub fn set_lna_gain_db(
&mut self,
gain_db: u8,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn set_lna_gain_db( &mut self, gain_db: u8, ) -> impl MaybeFuture<Output = Result<()>> + '_
Set RX IF/LNA gain in dB.
Sourcepub fn set_vga_gain_db(
&mut self,
gain_db: u8,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn set_vga_gain_db( &mut self, gain_db: u8, ) -> impl MaybeFuture<Output = Result<()>> + '_
Set baseband/VGA gain in dB.
Sourcepub fn set_amp_enable(
&mut self,
enabled: bool,
) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn set_amp_enable( &mut self, enabled: bool, ) -> impl MaybeFuture<Output = Result<()>> + '_
Enable or disable the RF amplifier.
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 antenna-port bias power.
HackRF firmware disables this when reception stops. A later stream start automatically reapplies the last successful setting.
Sourcepub fn rx_stream(&self) -> Result<RxStream>
pub fn rx_stream(&self) -> Result<RxStream>
Claim the device’s single owned receive stream.
The stream starts dormant. The device remains usable for live setters while reception is active. Dropping the stream releases the claim.
Sourcepub fn shutdown(&mut self) -> impl MaybeFuture<Output = Result<()>> + '_
pub fn shutdown(&mut self) -> impl MaybeFuture<Output = Result<()>> + '_
Put the transceiver in off mode and close the logical device session.
Returns Error::Busy while a receive stream is running. A stopped but
still-owned stream does not prevent shutdown, but cannot be restarted.