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§
- Discovered
Device - Protocol1
Client - Protocol 1 client for connecting to HPSDR hardware.
- Radio
Status
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.
- Protocol
Error
Constants§
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
_rbpfiltermapping. - 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)].