pub struct Protocol1Client { /* private fields */ }Expand description
Protocol 1 client for connecting to HPSDR hardware.
Implementations§
Source§impl Protocol1Client
impl Protocol1Client
Sourcepub async fn discover(timeout: Duration) -> Result<Vec<DiscoveredDevice>>
pub async fn discover(timeout: Duration) -> Result<Vec<DiscoveredDevice>>
Discover all HPSDR devices on the network using Protocol 1.
Sourcepub async fn discover_at(
addr: Ipv4Addr,
timeout: Duration,
) -> Result<Vec<DiscoveredDevice>>
pub async fn discover_at( addr: Ipv4Addr, timeout: Duration, ) -> Result<Vec<DiscoveredDevice>>
Send a discovery request to a specific address (unicast).
Sourcepub async fn connect(device: &DiscoveredDevice) -> Result<Self>
pub async fn connect(device: &DiscoveredDevice) -> Result<Self>
Connect to a discovered Protocol 1 device.
pub fn set_rx_frequency(&mut self, ddc: usize, freq_hz: u32)
pub fn set_tx_frequency(&mut self, freq_hz: u32)
pub fn set_sample_rate(&mut self, rate: u32)
pub fn set_nddc(&mut self, count: u8)
pub fn tx_drive(&self) -> u8
pub fn set_tx_drive(&mut self, drive: u8)
pub fn set_ptt(&mut self, on: bool)
pub fn set_rx_attenuation(&mut self, db: u8)
Sourcepub fn command_sender(&self) -> Sender<P1Command>
pub fn command_sender(&self) -> Sender<P1Command>
Get a sender for runtime commands. The run() loop polls this channel.
Sourcepub fn rx_iq_stream(&mut self, ddc: usize) -> Receiver<Vec<Complex<f64>>>
pub fn rx_iq_stream(&mut self, ddc: usize) -> Receiver<Vec<Complex<f64>>>
Get a receiver for IQ data from a specific DDC.
Sourcepub fn tx_iq_sink(&mut self) -> HeapProd<Complex<f64>>
pub fn tx_iq_sink(&mut self) -> HeapProd<Complex<f64>>
Get a producer for TX IQ data (lock-free ring buffer, zero-copy).
Sourcepub fn status_stream(&mut self) -> Option<Receiver<RadioStatus>>
pub fn status_stream(&mut self) -> Option<Receiver<RadioStatus>>
Get a receiver for radio status updates.
Returns None if already taken (can only be called once).
Auto Trait Implementations§
impl !Freeze for Protocol1Client
impl !RefUnwindSafe for Protocol1Client
impl Send for Protocol1Client
impl !Sync for Protocol1Client
impl Unpin for Protocol1Client
impl UnsafeUnpin for Protocol1Client
impl UnwindSafe for Protocol1Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more