Skip to content

Chunk 3.3: extract UV-5R driver into radios/baofeng_uv5r - #7

Merged
ww8l merged 1 commit into
mainfrom
chunk3.3-uv5r-driver
Jul 16, 2026
Merged

ww8l merged 1 commit into
mainfrom
chunk3.3-uv5r-driver

Conversation

@ww8l

@ww8l ww8l commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Mechanical extraction of the Baofeng UV-5R clone protocol from commands/program.rs into src-tauri/src/radios/baofeng_uv5r/ (serial handshake, block read/write, download, channel encode/decode, patch, verify — moved verbatim); commands/program_settings.rs moves in as the driver's settings.rs (100% rename).
  • BaofengUv5r implements RadioDriver + ImageProgrammer and is the first entry in the driver registry; DriverCapabilities now derive from a real impl.
  • commands/program.rs is now the thin Tauri command layer (DB lookups, backup naming, result DTOs). Command signatures are unchanged, so lib.rs and the frontend need no changes (that rewiring is 3.6/3.7).
  • Trait param tightened per the 3.1 note: ImageProgrammer::build_image/program_codeplug take &[SlotChannel] — slot-resolved channels are what image-clone radios consume. RadioModel derives Default for hardware-free driver tests.

Test plan

  • 147 lib tests pass (2 new: capability derivation, hardware-free build_image)
  • clippy warning count unchanged from main
  • Hardware-verified on a real UV-5R (BFB251 firmware): identify (UV5R_ORIG), download (6472-byte image, exact expected size), program 8-channel test codeplug → verified ✓ read-back including per-channel tones (off / Tone / TSQL)

🤖 Generated with Claude Code

Mechanical extraction of the Baofeng UV-5R clone protocol out of
commands/program.rs into radios/baofeng_uv5r/: serial handshake, block
read/write, download, channel encode/decode, patch, and verify move
verbatim; program_settings.rs moves in as the driver's settings module.
commands/program.rs is now the thin Tauri command layer (DB lookups,
backup naming, result DTOs) with unchanged command signatures, so
lib.rs and the frontend need no changes.

The driver implements RadioDriver + ImageProgrammer and is the first
entry in the registry; DriverCapabilities now derive from a real impl.
ImageProgrammer::build_image/program_codeplug take &[SlotChannel]
(slot-resolved channels are what both image-clone radios consume).
RadioModel derives Default for driver unit tests.

147 lib tests pass (2 new: capability derivation, hardware-free
build_image); clippy warning count unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ww8l
ww8l merged commit 59089ea into main Jul 16, 2026
3 checks passed
@ww8l
ww8l deleted the chunk3.3-uv5r-driver branch July 16, 2026 00:32
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