Skip to main content

Crate wifi_densepose_hardware

Crate wifi_densepose_hardware 

Source
Expand description

WiFi-DensePose hardware interface abstractions.

This crate provides platform-agnostic types and parsers for WiFi CSI data from various hardware sources:

  • ESP32/ESP32-S3: Parses ADR-018 binary CSI frames streamed over UDP
  • UDP Aggregator: Receives frames from multiple ESP32 nodes (ADR-018 Layer 2)
  • Bridge: Converts CsiFrame → CsiData for the detection pipeline (ADR-018 Layer 3)

§Design Principles

  1. No mock data: All parsers either parse real bytes or return explicit errors
  2. No hardware dependency at compile time: Parsing is done on byte buffers, not through FFI to ESP-IDF or kernel modules
  3. Deterministic: Same bytes in → same parsed output, always

§Example

use wifi_densepose_hardware::{CsiFrame, Esp32CsiParser, ParseError};

// Parse ESP32 CSI data from UDP bytes
let raw_bytes: &[u8] = &[/* ADR-018 binary frame */];
match Esp32CsiParser::parse_frame(raw_bytes) {
    Ok((frame, consumed)) => {
        println!("Parsed {} subcarriers ({} bytes)", frame.subcarrier_count(), consumed);
        let (amplitudes, phases) = frame.to_amplitude_phase();
        // Feed into detection pipeline...
    }
    Err(ParseError::InsufficientData { needed, got }) => {
        eprintln!("Need {} bytes, got {}", needed, got);
    }
    Err(e) => eprintln!("Parse error: {}", e),
}

Re-exports§

pub use sync_packet::SyncPacket;
pub use sync_packet::SyncPacketFlags;
pub use sync_packet::SYNC_PACKET_MAGIC;
pub use sync_packet::SYNC_PACKET_SIZE;
pub use sync_packet::SYNC_PACKET_PROTO_VER;
pub use radio_ops::crc32_ieee;
pub use radio_ops::decode_anomaly_alert;
pub use radio_ops::decode_mesh;
pub use radio_ops::decode_node_status;
pub use radio_ops::encode_health;
pub use radio_ops::AnomalyAlert;
pub use radio_ops::AuthClass;
pub use radio_ops::CaptureProfile;
pub use radio_ops::MeshError;
pub use radio_ops::MeshHeader;
pub use radio_ops::MeshMsgType;
pub use radio_ops::MeshRole;
pub use radio_ops::MockRadio;
pub use radio_ops::NodeStatus;
pub use radio_ops::RadioError;
pub use radio_ops::RadioHealth;
pub use radio_ops::RadioMode;
pub use radio_ops::RadioOps;
pub use radio_ops::MESH_HEADER_SIZE;
pub use radio_ops::MESH_MAGIC;
pub use radio_ops::MESH_MAX_PAYLOAD;
pub use radio_ops::MESH_VERSION;

Modules§

aggregator
UDP aggregator for ESP32 CSI nodes (ADR-018 Layer 2).
esp32
ESP32 hardware protocol modules.
ieee80211bf
IEEE 802.11bf-2025 WLAN sensing — forward-compatibility protocol model (ADR-153, amending ADR-152 §2.4).
radio_ops
ADR-081 Layer 1 Rust mirror + Layer 3 mesh-plane decoder.
sync_packet
ADR-110 §A0.12 sync packet decoder (firmware v0.6.9+).

Structs§

Adr018Flags
Flags encoded in ADR-018 byte 19 (ADR-110 extension).
AntennaConfig
Antenna configuration for MIMO.
CsiData
Pipeline-ready CSI data with amplitude and phase vectors (ADR-018).
CsiFrame
A parsed CSI frame containing subcarrier data and metadata.
CsiMetadata
Metadata associated with a CSI frame (ADR-018 format).
Esp32CsiParser
Parser for ESP32 CSI binary frames (ADR-018 format).
SubcarrierData
A single subcarrier’s I/Q data.

Enums§

Bandwidth
WiFi channel bandwidth.
ParseError
Errors that can occur when parsing CSI data from hardware.
PpduType
PPDU type encoded in ADR-018 byte 18 (ADR-110 extension).

Constants§

ESP32_CSI_MAGIC
ESP32 CSI binary frame magic number (ADR-018).
RUVIEW_COMPRESSED_CSI_MAGIC
ADR-039 compressed-CSI packet.
RUVIEW_FEATURE_MAGIC
ADR-069 feature-vector packet.
RUVIEW_FEATURE_STATE_MAGIC
ADR-081 compact feature-state packet (the default upstream payload).
RUVIEW_FUSED_VITALS_MAGIC
ADR-063 fused-vitals packet (multi-sensor fusion).
RUVIEW_TEMPORAL_MAGIC
ADR-095 / #513 on-device temporal-classification packet.
RUVIEW_VITALS_MAGIC
ADR-039 edge vitals packet (32 bytes: HR/BR/presence).

Functions§

ruview_sibling_packet_name
If magic is a recognized RuView wire packet other than the ADR-018 raw CSI frame, return a human-readable name for it; otherwise None.