Skip to main content

Crate radio_utils_protocol

Crate radio_utils_protocol 

Source
Expand description

HPSDR Protocol 1 client library.

Provides shared protocol types (HpsdrHw, DiscoveredDevice, RadioStatus), IQ sample pack/unpack routines (24-bit RX, 16-bit TX), and UDP transport abstractions.

With the client feature enabled, includes Protocol1Client for discovery, streaming, and control command handling over UDP.

Re-exports§

pub use iq_accumulator::IqAccumulator;

Modules§

iq_accumulator
packets
Stateless Protocol 1 packet parsing and building functions.
transport

Structs§

DiscoveredDevice
Protocol1Client
Protocol 1 client for connecting to HPSDR hardware.
RadioStatus

Enums§

HpsdrHw
Hardware identity of the radio. The crate targets two boards: the original Hermes and the Hermes Lite 2. Filter, attenuator, and PA wiring differ; the enum dispatches the variant-specific control bytes.
P1Command
Commands that can be sent to the Protocol 1 client while it is running.
ProtocolError

Constants§

SAMPLE_RATES_P1

Functions§

alex_rx_hpf_for_freq
Alex RX HPF bits for C0=0x12 C3. Returns the HPF selector bits matching the Thetis mapping.
alex_tx_lpf_for_freq
Alex TX LPF bit for C0=0x12 C4. Returns a single-bit value matching the Thetis _rbpfilter mapping.
mac_to_string
n2adr_oc_for_freq
N2ADR OC output value for HL2 (C0=0x00 C2, shifted left by 1 by caller).
p1_code_to_sample_rate
pack_iq_24bit_into
Pack a Complex IQ sample into 6 bytes (24-bit signed big-endian).
pack_iq_24bit_into_ex
Pack a Complex IQ sample into 6 bytes (24-bit signed big-endian) with configurable Q-sign convention.
pack_iq_24bit_into_negate_q
Pack a Complex IQ sample into 6 bytes (24-bit signed big-endian).
pack_tx_iq_16bit
Pack TX IQ samples into Protocol 1 format. Each 8-byte block: [L(2B) R(2B) I(2B) Q(2B)], L/R set to 0.
sample_rate_to_p1_code
unpack_iq_24bit
Unpack a 24-bit signed big-endian IQ sample from 6 bytes into Complex.
unpack_tx_iq_16bit
Unpack 16-bit signed big-endian TX IQ from Protocol 1 sub-frame. Each 8-byte block: [L(2B) R(2B) I(2B) Q(2B)].

Type Aliases§

Result