Files
Mathew Beaneandclaude-flow f8ab204711 fix(wifiscan): keep the redacted macOS connected link; auto+wifi keeps UDP bound
On macOS 27, without Location Services, CoreWLAN redacts both the SSID and
the BSSID, while rssi, noise and channel stay real. resolve_bssid abstained
when both identities were blank, so every macOS scan was dropped and
`--source wifi` silently produced nothing.

- mac_wifi --scan-once marks its sample `"connected": true`. It is always the
  single connected link, so a synthetic id cannot merge two networks.
- A redacted connected sample gets a stable locally administered synthetic
  BSSID; the SSID stays empty. Unmarked redacted lines still abstain.
- `--source auto` that resolves to host WiFi now also binds UDP, and wifi_task
  yields while the source is a live esp32, so ESP32 nodes that start after
  the boot probe still promote the source (the #1004 rule). Without this, the
  fix would make stock Macs ignore late-starting nodes.
- A missing helper is reported once, with the build command.
- ADR-025: Updated row + Amendment 1 recording the measured behaviour.

Measured on macOS 27: --source wifi gives source wifi:unnamed with sensing
ticks advancing; --source auto on a quiet port starts on wifi with
udp_receiver=true and promotes to esp32 (5 nodes) when real frames arrive.
Tests: wifiscan 158+1, sensing-server bin 332, all passing.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-10-02 03:11:08 -04:00
..

wifi-densepose-wifiscan

Crates.io Documentation License

Multi-BSSID WiFi scanning for Windows-enhanced DensePose sensing (ADR-022).

Overview

wifi-densepose-wifiscan implements the BSSID Acquisition bounded context for the WiFi-DensePose system. It discovers and tracks nearby WiFi access points, parses platform-specific scan output, and feeds multi-AP signal data into a sensing pipeline that performs motion detection, breathing estimation, attention weighting, and fingerprint matching.

The crate uses #[forbid(unsafe_code)] and is designed as a pure-Rust domain layer with pluggable platform adapters.

Features

  • BSSID registry -- Tracks observed access points with running RSSI statistics, band/radio type classification, and metadata. Types: BssidId, BssidObservation, BssidRegistry, BssidEntry.
  • Netsh adapter (Tier 1) -- Parses netsh wlan show networks mode=bssid output into structured BssidObservation records. Zero platform dependencies.
  • WLAN API scanner (Tier 2, wlanapi feature) -- Async scanning via the Windows WLAN API with tokio integration.
  • Multi-AP frame -- MultiApFrame aggregates observations from multiple BSSIDs into a single timestamped frame for downstream processing.
  • Sensing pipeline (pipeline feature) -- WindowsWifiPipeline orchestrates motion detection, breathing estimation, attention-weighted AP selection, and location fingerprint matching.

Feature flags

Flag Default Description
serde yes Serialization for domain types
pipeline yes WindowsWifiPipeline sensing orchestration
wlanapi no Tier 2 async scanning via tokio (Windows WLAN API)

Quick Start

use wifi_densepose_wifiscan::{
    NetshBssidScanner, BssidRegistry, WlanScanPort,
};

// Parse netsh output (works on any platform for testing)
let netsh_output = "..."; // output of `netsh wlan show networks mode=bssid`
let observations = wifi_densepose_wifiscan::parse_netsh_output(netsh_output);

// Register observations
let mut registry = BssidRegistry::new();
for obs in &observations {
    registry.update(obs);
}

println!("Tracking {} access points", registry.len());

With the pipeline feature enabled:

use wifi_densepose_wifiscan::WindowsWifiPipeline;

let pipeline = WindowsWifiPipeline::new();
// Feed MultiApFrame data into the pipeline for sensing...

Architecture

wifi-densepose-wifiscan/src/
  lib.rs          -- Re-exports, feature gates
  domain/
    bssid.rs      -- BssidId, BssidObservation, BandType, RadioType
    registry.rs   -- BssidRegistry, BssidEntry, BssidMeta, RunningStats
    frame.rs      -- MultiApFrame (multi-BSSID aggregated frame)
    result.rs     -- EnhancedSensingResult
  port.rs         -- WlanScanPort trait (platform abstraction)
  adapter.rs      -- NetshBssidScanner (Tier 1), WlanApiScanner (Tier 2)
  pipeline.rs     -- WindowsWifiPipeline (motion, breathing, attention, fingerprint)
  error.rs        -- WifiScanError
Crate Role
wifi-densepose-signal Advanced CSI signal processing
wifi-densepose-vitals Vital sign extraction from CSI
wifi-densepose-hardware ESP32 and other hardware interfaces
wifi-densepose-mat Disaster detection using multi-AP data

License

MIT OR Apache-2.0