Protocols & DSL Overview
The HamBench ecosystem uses JSON languages to describe clone-style serial I/O and EEPROM layout. A generic driver and codec interpret the data, so new radios are added with configuration rather than new TypeScript classes.
Two DSLs
| DSL | Purpose |
|---|---|
| Protocol DSL | Serial handshake and chunked memory transfer |
| Memory-Map DSL | EEPROM bytes ↔ radio settings (and UI metadata) |
Why declarative radio support?
- Radio independence: One interpreter supports many radios.
- Declarative: Handshake, layout, and menus are data, not TypeScript.
- Testable: Protocol and memory-map JSON validate against schemas.
Protocol DSL (I/O)
- Exchange:
sendbytes andexpecta reply (exact ACK, N opaque bytes, or a framed pattern). - Chunk loop:
read/writerepeats an exchange across named memory segments. - Placeholders:
$address,$chunkSize,$length,$dataare filled in at runtime. - Write extras: optional
chunkSize,delay, andskipon awritestep (UV-5R clone uses 16-byte blocks).
Memory-Map DSL (settings)
- Structs at radio EEPROM
seekaddresses with sequential fields. - Encodings: integers, enums, booleans, ASCII, digit arrays, DTMF, BCD, bitfields.
- UI metadata:
groups(left nav), nested sub-groups (panel sections), plus per-field group, label, widget.
See the Memory-Map DSL for UV-5R address conversion (Chirp image − 8) and the “no code” path for a new radio.
Next steps
- Learn the Protocol DSL in detail
- Learn the Memory-Map DSL in detail
- See how protocols load through the Registry Architecture
- Explore the Development Guide for implementation details