feat: add hostd — desktop WiFi/BLE scanner with WiGLE CSV output#111
Open
feat: add hostd — desktop WiFi/BLE scanner with WiGLE CSV output#111
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new desktop host daemon (hostd/) that runs WiFi (CoreWLAN) and BLE (btleplug) scanning on desktop platforms, logging all observations in WiGLE CSV v1.6 format with GPS coordinates from CoreLocation. It also makes minimal library changes to support the desktop platform, including a new board-host feature and a cfg-gated security field on WiFiEvent.
Changes:
- New
hostd/crate with WiFi/BLE scanners, WiGLE CSV writer, CoreLocation GPS integration, and NDJSON match output - Library changes:
board-hostfeature flag with desktop platform constants,securityfield onWiFiEvent(cfg-gated behindnot(esp32)) - CI/tooling: new
hostdCI job (check/clippy/test), fmt and audit for hostd, conditional pre-commit hook, and justfile targets
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
hostd/src/main.rs |
Main daemon: spawns BLE/WiFi scanners, filter task, stdin command loop, WiGLE CSV output |
hostd/src/wigle.rs |
WiGLE CSV v1.6 writer with WiFi/BLE row formatters and comprehensive tests |
hostd/src/ble.rs |
BLE scanner using btleplug, converting peripheral properties to AirHound BleEvents |
hostd/src/wifi_macos.rs |
macOS WiFi scanner using CoreWLAN via wifi_scan crate |
hostd/src/location_macos.rs |
CoreLocation GPS provider for macOS |
hostd/Cargo.toml |
Crate manifest with platform-conditional macOS dependencies |
hostd/Cargo.lock |
Lock file for hostd dependencies |
hostd/rust-toolchain.toml |
Stable Rust toolchain for hostd |
hostd/macos/Info.plist |
macOS app bundle plist for Location Services authorization |
src/scanner.rs |
Added cfg-gated security field to WiFiEvent |
src/board.rs |
Added board-host module with desktop platform constants |
Cargo.toml |
Added board-host feature flag |
justfile |
Added hostd build/run/test/check/clippy/fmt targets |
.github/workflows/ci.yml |
Added hostd CI job, fmt check, and dependency audit |
.githooks/pre-commit |
Conditional test runs for hostd and library changes |
.gitignore |
Added hostd build artifacts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| let _ = name.push_str(&local_name[..end]); | ||
| } | ||
|
|
||
| let rssi = props.rssi.unwrap_or(0) as i8; |
Add `security: heapless::String<64>` to WiFiEvent for WiGLE AuthMode output, cfg-gated behind `not(esp32)` to avoid DRAM cost on ESP32. Add `board-host` feature with desktop platform constants. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Host daemon that scans WiFi (CoreWLAN) and BLE (btleplug), logs ALL observations in WiGLE CSV v1.6 format, and emits NDJSON on stdout for matched surveillance devices. GPS tagging via CoreLocation on macOS. - BLE scanner via btleplug with CoreBluetooth backend - WiFi scanner via wifi_scan with CoreWLAN backend - CoreLocation GPS provider with authorization request - WiGLE CSV v1.6 writer using csv crate (proper RFC 4180 escaping) - macOS .app bundle for Location Services permission prompt - clap CLI with --output flag (defaults to airhound-YYYYMMDD-HHMMSS.csv) - Non-fatal scanner exits (BLE/WiFi dying doesn't kill the daemon) - Periodic CSV flush (every 5s) for crash durability Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- CI: hostd check, clippy, test job on ubuntu-latest; fmt and audit - justfile: build-hostd, bundle-hostd, run-hostd (macOS/Linux), check-hostd, test-hostd, fmt-hostd, clippy-hostd recipes - pre-commit: run hostd tests when hostd/ or src/ changes; make library tests conditional on staged src/ files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hostd/) that scans WiFi (CoreWLAN) and BLE (btleplug) on desktop, logging ALL observations in WiGLE CSV v1.6 format with GPS coordinates from CoreLocationjust bundle-hostdassembles it,just run-hostdlaunches via the bundle path so the system prompt appearssecurityfield onWiFiEvent(cfg-gated, no ESP32 DRAM cost),board-hostfeature with desktop platform constantsDetails
csvcrate for correct RFC 4180 escapingTest plan
cargo test— 20 hostd tests pass (wigle writer, BLE converter, MAC parser)cargo clippy -- -D warnings— cleancargo test --lib --no-default-features)libdbus-1-dev)just docker-build) —securityfield is cfg-gated🤖 Generated with Claude Code