1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Rust-native RX-only HackRF driver built on [`nusb`].
//!
//! One-shot operations and receive-stream operations implement [`MaybeFuture`]:
//! await them in asynchronous code, or call [`MaybeFuture::wait`] on native
//! targets. The receive stream owns its USB endpoint and transfer queue, so the
//! steady-state read path does not lock shared device state.
//!
//! # Synchronous example
//!
//! ```no_run
//! use hackrf_nusb::{Complex32, Device, MaybeFuture};
//! use std::time::Duration;
//!
//! fn main() -> hackrf_nusb::Result<()> {
//! let mut device = Device::builder()
//! .frequency_hz(100_000_000)
//! .sample_rate_hz(10_000_000)
//! .open()
//! .wait()?;
//! let mut rx = device.rx_stream()?;
//! rx.start().wait()?;
//! let mut samples = [Complex32::default(); 1024];
//! let count = rx.read(&mut samples, Some(Duration::from_secs(1))).wait()?;
//! println!("received {count} IQ samples");
//! rx.stop().wait()?;
//! drop(rx);
//! device.shutdown().wait()?;
//! Ok(())
//! }
//! ```
//!
//! On `wasm32`, call `Device::request_permission` from a browser-window user
//! gesture before opening the device. WebUSB operations are asynchronous only.
pub use ;
pub use MAX_COMPLEX_SAMPLES_PER_TRANSFER;
pub use DeviceDescriptor;
pub use ;
pub use ;
pub use Complex32;
pub use MaybeFuture;
pub use StreamingStats;
pub use ;