feat(wifiscan): add Rust macOS + Linux adapters, fix Python byte counters
- Add MacosCoreWlanScanner (macOS): CoreWLAN Swift helper adapter with synthetic BSSID generation via FNV-1a hash for redacted MACs (ADR-025) - Add LinuxIwScanner (Linux): parses `iw dev <iface> scan` output with freq-to-channel conversion and BSS stanza parsing - Both adapters produce Vec<BssidObservation> compatible with the existing WindowsWifiPipeline 8-stage processing - Platform-gate modules with #[cfg(target_os)] so each adapter only compiles on its target OS - Fix Python MacosWifiCollector: remove synthetic byte counters that produced misleading tx_bytes/rx_bytes data (set to 0) - Add compiled Swift binary (mac_wifi) to .gitignore Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -696,15 +696,12 @@ class MacosWifiCollector:
|
||||
bufsize=1 # Line buffered
|
||||
)
|
||||
|
||||
synth_tx = 0
|
||||
synth_rx = 0
|
||||
|
||||
while self._running and self._process and self._process.poll() is None:
|
||||
try:
|
||||
line = self._process.stdout.readline()
|
||||
if not line:
|
||||
continue
|
||||
|
||||
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
@@ -714,22 +711,19 @@ class MacosWifiCollector:
|
||||
if "error" in data:
|
||||
logger.error("macOS WiFi utility error: %s", data["error"])
|
||||
continue
|
||||
|
||||
|
||||
rssi = float(data.get("rssi", -80.0))
|
||||
noise = float(data.get("noise", -95.0))
|
||||
|
||||
|
||||
link_quality = max(0.0, min(1.0, (rssi + 100.0) / 60.0))
|
||||
|
||||
synth_tx += 1500
|
||||
synth_rx += 3000
|
||||
|
||||
|
||||
sample = WifiSample(
|
||||
timestamp=time.time(),
|
||||
rssi_dbm=rssi,
|
||||
noise_dbm=noise,
|
||||
link_quality=link_quality,
|
||||
tx_bytes=synth_tx,
|
||||
rx_bytes=synth_rx,
|
||||
tx_bytes=0,
|
||||
rx_bytes=0,
|
||||
retry_count=0,
|
||||
interface=self._interface,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user