mirror of
https://github.com/ruvnet/RuView
synced 2026-08-06 19:51:43 +00:00
f49c722764
The Rust port lived two directories deep (rust-port/wifi-densepose-rs/) without any sibling under rust-port/ that warranted the extra level. Move the whole workspace up to v2/ to match v1/ (Python) at the same depth and shorten every cd / build command across the repo. git mv preserves history for all tracked files. 60 files updated for path references (CI workflows, ADRs, docs, scripts, READMEs, internal .claude-flow state). Two manual fixes for relative-cd paths in CLAUDE.md and ADR-043 that became wrong after the depth change (cd ../.. → cd ..). Validated: - cargo check --workspace --no-default-features → clean (after target/ nuke; the gitignored target/ was carried by the OS rename and had hard-coded old paths in build scripts) - cargo test --workspace --no-default-features → 1,539 passed, 0 failed, 8 ignored (same totals as pre-rename) - ESP32-S3 on COM7 → still streaming live CSI (cb #40300, RSSI -64 dBm) After-merge follow-up: contributors should `rm -rf v2/target` once and let cargo regenerate from the new path.
61 lines
2.3 KiB
Rust
61 lines
2.3 KiB
Rust
//! 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
|
|
//!
|
|
//! ```rust
|
|
//! 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),
|
|
//! }
|
|
//! ```
|
|
|
|
mod csi_frame;
|
|
mod error;
|
|
mod esp32_parser;
|
|
pub mod aggregator;
|
|
mod bridge;
|
|
pub mod esp32;
|
|
|
|
// ADR-081: Rust mirror of the firmware radio abstraction layer (L1) and
|
|
// mesh sensing plane (L3). Lets host tests, simulators, and future
|
|
// coordinator-node Rust code drive the controller stack without
|
|
// touching any downstream signal/ruvector/train/mat crate.
|
|
pub mod radio_ops;
|
|
|
|
pub use csi_frame::{CsiFrame, CsiMetadata, SubcarrierData, Bandwidth, AntennaConfig};
|
|
pub use error::ParseError;
|
|
pub use esp32_parser::Esp32CsiParser;
|
|
pub use bridge::CsiData;
|
|
pub use radio_ops::{
|
|
RadioOps, RadioMode, CaptureProfile, RadioHealth, RadioError, MockRadio,
|
|
MeshRole, MeshMsgType, AuthClass, MeshHeader, NodeStatus, AnomalyAlert,
|
|
MeshError, MESH_MAGIC, MESH_VERSION, MESH_HEADER_SIZE, MESH_MAX_PAYLOAD,
|
|
crc32_ieee, decode_mesh, decode_node_status, decode_anomaly_alert,
|
|
encode_health,
|
|
};
|