mirror of
https://github.com/ruvnet/RuView
synced 2026-08-05 19:41:44 +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.
55 lines
1.5 KiB
Rust
55 lines
1.5 KiB
Rust
//! Error types for hardware parsing.
|
|
|
|
use thiserror::Error;
|
|
|
|
/// Errors that can occur when parsing CSI data from hardware.
|
|
#[derive(Debug, Error)]
|
|
pub enum ParseError {
|
|
/// Not enough bytes in the buffer to parse a complete frame.
|
|
#[error("Insufficient data: need {needed} bytes, got {got}")]
|
|
InsufficientData {
|
|
needed: usize,
|
|
got: usize,
|
|
},
|
|
|
|
/// The frame header magic bytes don't match expected values.
|
|
#[error("Invalid magic: expected {expected:#06x}, got {got:#06x}")]
|
|
InvalidMagic {
|
|
expected: u32,
|
|
got: u32,
|
|
},
|
|
|
|
/// The frame indicates more subcarriers than physically possible.
|
|
#[error("Invalid subcarrier count: {count} (max {max})")]
|
|
InvalidSubcarrierCount {
|
|
count: usize,
|
|
max: usize,
|
|
},
|
|
|
|
/// The I/Q data buffer length doesn't match expected size.
|
|
#[error("I/Q data length mismatch: expected {expected}, got {got}")]
|
|
IqLengthMismatch {
|
|
expected: usize,
|
|
got: usize,
|
|
},
|
|
|
|
/// RSSI value is outside the valid range.
|
|
#[error("Invalid RSSI value: {value} dBm (expected -100..0)")]
|
|
InvalidRssi {
|
|
value: i32,
|
|
},
|
|
|
|
/// Invalid antenna count (must be 1-4 for ESP32).
|
|
#[error("Invalid antenna count: {count} (expected 1-4)")]
|
|
InvalidAntennaCount {
|
|
count: u8,
|
|
},
|
|
|
|
/// Generic byte-level parse error.
|
|
#[error("Parse error at offset {offset}: {message}")]
|
|
ByteError {
|
|
offset: usize,
|
|
message: String,
|
|
},
|
|
}
|