Skip to content

feat(syntonia): USB hardware detection + radio auto-detect#16

Merged
forkwright merged 1 commit into
mainfrom
p1-06/usb-detection
Mar 16, 2026
Merged

feat(syntonia): USB hardware detection + radio auto-detect#16
forkwright merged 1 commit into
mainfrom
p1-06/usb-detection

Conversation

@forkwright
Copy link
Copy Markdown
Owner

Summary

  • USB cable scanning with VID:PID matching (PL2303, CH340, CP2102, FTDI)
  • PL2303 clone detection via nusb bcdDevice version check with user warning
  • Serial port radio probing via magic byte auto-detect sequence (Baofeng UV-5R family)
  • Actionable error messages (dialout group hint, cable troubleshooting)
  • detect_radios() for automatic discovery, detect_radio_on_port() for explicit

Test plan

  • cargo build && cargo test --workspace — 28 syntonia tests + 138 koinon tests pass
  • cargo clippy --workspace --all-targets -- -D warnings — zero warnings
  • cargo fmt --all -- --check — clean
  • Known cable VID:PIDs identified correctly (8 cable tests)
  • Radio detection via mock serial port (10 detect tests)
  • Warning generation for clones, permissions, unknown cables (6 warning tests)
  • No .unwrap() or .expect() outside #[cfg(test)]

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Large PR detected — 8 files, 1547 lines changed.

Consider splitting into smaller PRs for easier review. Not a blocker, just a signal.

Add syntonia crate with hardware detection module:
- USB cable scanning via serialport::available_ports() with VID:PID matching
- Known cable table: PL2303, CH340, CP2102, FTDI
- PL2303 clone detection via nusb bcdDevice version check
- Radio probing via magic byte handshake (Baofeng UV-5R family)
- detect_radios() for automatic discovery, detect_radio_on_port() for explicit
- Actionable warnings: dialout group hint, clone advisory, unknown cable notice
- 28 tests covering cable classification, mock serial probing, and warning generation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@forkwright forkwright force-pushed the p1-06/usb-detection branch from 77cb99c to e6c1ce9 Compare March 15, 2026 15:37
@forkwright forkwright merged commit 37de389 into main Mar 16, 2026
7 of 13 checks passed
@forkwright forkwright deleted the p1-06/usb-detection branch March 16, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant