diff --git a/README.md b/README.md index e2d42eb..948983e 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,15 @@ including programming several different radios from the same codeplug. | **Baofeng UV-6** | Experimental (CHIRP-based) | Analog FM | 130–176 / 400–520 MHz | Programming cable — read, write, settings | 128 channels; 19 settings — the ones CHIRP offers for it. No aux block, so no power-on message or band limits, and no VFO or DTMF settings. Also the UV-7 | | **Baofeng GT-5R** | Experimental (CHIRP-based) | Analog FM | 144–148 / 420–450 MHz TX, 130–176 / 400–520 MHz RX | Programming cable — read, write, settings | 128 channels; the UV-5R's 74 settings. Answers the same magic as the UV-5R. Channels outside the transmit bands are programmed receive-only | | **Radioddity UV-5G** | Experimental (CHIRP-based) | Analog FM | 130–176 / 400–520 MHz | Programming cable — read, write, settings | 128 channels; the UV-5R's 74 settings. Sold for GMRS; whether it refuses to transmit outside GMRS is not known here. Its firmware uses a different DTMF code map, which the app follows | +| **Baofeng BF-A58** | Experimental (CHIRP-based) | Analog FM | 130–180 / 400–521 MHz | Programming cable — read, write, settings | 128 channels, High / Low power; 72 settings, reaching 32 of the 39 settings menus in its manual (four more, the tone menus, on channels only). On the UV-5R's driver with CHIRP's WP970I map (`baofeng_wp970i.py`). Also sold as the Rugged RH5X and UV-9R Pro. Answers the same magic as the UV-82WP, GT-3WP, RT6, BF-A58S and UV-9R, so pick the model that matches the radio | +| **Baofeng UV-82WP** | Experimental (CHIRP-based) | Analog FM | 130–180 / 400–521 MHz | Programming cable — read, write, settings | 128 channels, High / Low power, 6-character names; the BF-A58's 72 settings | +| **Baofeng GT-3WP** | Experimental (CHIRP-based) | Analog FM | 130–180 / 400–521 MHz | Programming cable — read, write, settings | 128 channels, High / Low power; the BF-A58's 72 settings, 32 of the manual's 39 settings menus | +| **Retevis RT6** | Experimental (CHIRP-based) | Analog FM | 130–180 / 400–521 MHz | Programming cable — read, write, settings | 128 channels, High / Low power, 6-character names; the BF-A58's 72 settings, 32 of the manual's 39 settings menus | +| **Baofeng BF-A58S** | Experimental (CHIRP-based) | Analog FM | 130–180 / 200–260 / 400–521 MHz | Programming cable — read, write, settings | 128 channels, High / Low power; 74 settings — the BF-A58's plus the 220 band limits. Also sold as the UV-82III | +| **Baofeng UV-S9X3** | Experimental (CHIRP-based) | Analog FM | 130–180 / 200–260 / 400–521 MHz | Programming cable — read, write, settings | 128 channels, High / Low power; the BF-A58S's 74 settings. Answers the same magic as the UV-5R and 5RX, so pick the model that matches the radio | +| **Baofeng 5RX** | Experimental (CHIRP-based) | Analog FM | 136–174 / 200–260 / 400–520 MHz TX, 108–174 / 200–260 / 350–390 / 400–520 MHz RX | Programming cable — read, write, settings | 128 channels, High / Low power; the BF-A58S's 74 settings, 31 of the manual's 37 settings menus. Channels in the air band and 350–390 MHz are programmed receive-only | +| **Baofeng UV-9R** | Experimental (CHIRP-based) | Analog FM | 130–180 / 400–521 MHz | Programming cable — read, write, settings | 128 channels, High / Low power; the BF-A58's 72 settings, 32 of the manual's 39 settings menus | +| **Baofeng UV-9G** | Experimental (CHIRP-based) | Analog FM | 130–180 / 400–521 MHz | Programming cable — read, write, settings | 128 channels, High / Low power; the BF-A58's 72 settings, 32 of the manual's 39 settings menus. Sold for GMRS; CHIRP programs it full-band, and whether it refuses to transmit outside GMRS is not known here | | **TIDRADIO TD-H3** | ✓ | Analog FM/NFM/AM | VHF / UHF / 1.25 m | Direct USB — read, write, settings | 200 channels, tri-band | | **AnyTone AT-D890UV** | ✓ | DMR + Analog | VHF / UHF | Direct USB — channels, zones, scan lists, settings, call-sign DB | 4000 channels; full DMR: zones, talkgroups, 308k-entry caller-ID database | | **AnyTone AT-D578UV** | ✓ | DMR + Analog mobile | 2 m / 1.25 m / 70 cm | Direct USB — channels, zones, scan lists, talkgroups, settings, call-sign DB | 4000 channels in 250 zones; 264 menu settings including the FM and DMR APRS setup; 500k-entry caller-ID database. AM channels in 108–136 MHz go to the air-band memory, which only the D578UV **PLUS** receives — that part is written to the published map but has not been checked on a PLUS. Same protocol as the D890UV over a different memory map | @@ -56,14 +65,16 @@ including programming several different radios from the same codeplug. read back. A radio marked **Experimental** was built from published research and the open-source CHIRP project and checked byte for byte against CHIRP's own output, but has not yet been tested on a real radio by this project. Where the manufacturer's own programming software was available, it -was also used to open the app's images (the Baofeng UV-82, UV-82HP and BF-F8HP); where it disagreed -with CHIRP, the app follows the manufacturer. Save a backup from the radio before writing to one. +was also used to open the app's images (the Baofeng UV-82, UV-82HP, BF-F8HP, GT-3WP and UV-9R); +where it disagreed with CHIRP, the app follows the manufacturer. Save a backup from the radio before writing to one. If you own one, an issue saying what works and what doesn't is what moves it to ✓. See [docs/radios/baofeng-uv5r-family.md](docs/radios/baofeng-uv5r-family.md) for the Baofeng family's evidence. Direct USB and cable programming reads the radio's current image, applies your changes, backs up -the original, writes, and can verify the result byte-for-byte. The Kenwood TM-D710 and the Yaesu +the original, writes, and can verify the result byte-for-byte. On the Baofeng UV-5R family a backup +can also be put back whole, and that includes a `.img` saved by CHIRP, which is accepted only for +the model CHIRP's own metadata in the file names. The Kenwood TM-D710 and the Yaesu FT-891 have no image to clone: they are programmed live, one memory at a time, and each memory is read back after it is written. The ID-5100 clones its whole image at once and refuses a clone it cannot accept by resetting itself to factory defaults, so the @@ -114,7 +125,8 @@ bench. If you own one of these and want to help measure or test it, say so on it database, with prioritized export and direct caller-ID database programming (AnyTone D890UV, D578UV and D868UV; TYT MD-380 with patched firmware). - **Direct radio programming** over USB or a programming cable (Baofeng UV-5R, and as Experimental - models the UV-82, UV-82HP, UV-82X3, BF-F8HP, UV-6, GT-5R and UV-5G; TIDRADIO TD-H3, + models the UV-82, UV-82HP, UV-82X3, BF-F8HP, UV-6, GT-5R, UV-5G, BF-A58, BF-A58S, UV-82WP, + GT-3WP, UV-S9X3, 5RX, UV-9R and UV-9G and the Retevis RT6; TIDRADIO TD-H3, AnyTone D890UV, D578UV and D868UV, Binteradio BT-9000, Icom ID-5100, Kenwood TH-D72 and TM-D710, Quansheng UV-K5 (stock and egzumer), TYT MD-380, Yaesu FT-857D / FT-897 and FT-891) with backup, write, and read-back verify. @@ -210,8 +222,9 @@ WW8L Codeplug Magic is licensed under the **GNU General Public License v3.0** Every borrowing is also cited at its use site in the source. This section is the summary. **[CHIRP](https://chirpmyradio.com)** — GPLv3, compatible. Struct layouts, tone tables, and -encode/decode routines for the Baofeng and TIDRADIO drivers, including the seven Experimental -UV-5R-family models (from `uv5r.py`: idents, power levels, bands and per-model settings); the FT5D settings map (from +encode/decode routines for the Baofeng and TIDRADIO drivers, including the sixteen Experimental +UV-5R-family models (from `uv5r.py`, and from `baofeng_wp970i.py` and `baofeng_common.py` for the +BF-A58 / UV-9R class: idents, power levels, bands and per-model settings); the FT5D settings map (from `ft1d.py`); the Icom `.icf` container format and the Icom clone protocol (from `icf.py`); the ID-5100 memory, bank and bitmap layout (from `id5100.py`); the ID-51 Plus memory, bank and bitmap layout (from `id51plus.py`); and the TH-D75 channel memory layout (from `thd74.py`). diff --git a/docs/radios/baofeng-uv5r-family.md b/docs/radios/baofeng-uv5r-family.md index 8925ad7..a29ff0b 100644 --- a/docs/radios/baofeng-uv5r-family.md +++ b/docs/radios/baofeng-uv5r-family.md @@ -1,11 +1,13 @@ # Baofeng UV-5R family — the Experimental models (#168) -Seven radios on the UV-5R clone protocol, each a model of its own on the +Sixteen radios on the UV-5R clone protocol, each a model of its own on the hardware-verified UV-5R session code (`src-tauri/src/radios/baofeng_uv5r`). -**All seven are Experimental**: built from CHIRP's `chirp/drivers/uv5r.py` -(b63b38d1, 2026-11-29; GPLv2-or-later) with no radio on the desk. Nothing about -any of them has been confirmed on hardware. The app labels them and warns -before every write. +**All sixteen are Experimental**: built from CHIRP (b63b38d1, 2026-11-29; +GPLv2-or-later) with no radio on the desk. Seven come from `chirp/drivers/uv5r.py` +(#168's first entry); nine from `baofeng_wp970i.py` on `baofeng_common.py` +(#168's second entry, [the WP970I class](#the-wp970i-class-bf-a58--uv-9r)). +Nothing about any of them has been confirmed on hardware. The app labels them +and warns before every write. | Model | `driver_key` | CHIRP class | Magic(s) | Aux block | Power | Bands | Settings | |---|---|---|---|---|---|---|---| @@ -19,6 +21,117 @@ before every write. Bands are CHIRP's `valid_bands`, not the manufacturers' spec sheets. +## The WP970I class (BF-A58 / UV-9R) + +CHIRP's `baofeng_wp970i.py` is a separate driver, but its `#seekto`s are radio +addresses and they land on the UV-5R's map: channels at 0x0000, names at +0x1000, the settings struct at 0x0E20 (byte for byte `uv5r.py`'s), VFOs at +0x0F08 / 0x0F28, ANI at 0x0CAA, the power-on message at 0x1EE0, the band +limits at 0x1FC0. Its clone code (`baofeng_common.py`) reads the same `S` / +`X` blocks, in the same order (the 0x1E80 / 0x1EC0 / 0x1FC0 probe, then main, +then aux), with the same dropped-byte workaround. Only its image *file* differs: +radio 0x0000–0x2000 with the ident at the end, where ours keeps `uv5r.py`'s +ident-first layout. So these are Variants on the same session, not a driver of +their own. (CHIRP's own BF-F8HP class in `uv5r.py` already tries the WP970I +magic — it is the A58 one.) + +| Model | `driver_key` | CHIRP class | Magic | Power | Names | Bands | Settings | +|---|---|---|---|---|---|---|---| +| Baofeng BF-A58 | `baofeng_bfa58` | `BFA58` | WP970I | High / Low (0 / 1) | 7 | 130–180, 400–521 | 72 | +| Baofeng UV-82WP | `baofeng_uv82wp` | `UV82WP` | WP970I | High / Low (0 / 1) | 6 | 130–180, 400–521 | 72 | +| Baofeng GT-3WP | `baofeng_gt3wp` | `GT3WP` | WP970I | High / Low (0 / 1) | 7 | 130–180, 400–521 | 72 | +| Retevis RT6 | `retevis_rt6` | `RT6` | WP970I | High / Low (0 / 1) | 6 | 130–180, 400–521 | 72 | +| Baofeng UV-9R | `baofeng_uv9r` | `UV9R` | WP970I | High / Low (0 / 1) | 7 | 130–180, 400–521 | 72 | +| Baofeng UV-9G | `baofeng_uv9g` | `UV9G` | UV9G | High / Low (0 / 1) | 7 | 130–180, 400–521 | 72 | +| Baofeng BF-A58S | `baofeng_bfa58s` | `BFA58S` | WP970I | High / Low (0 / 2) | 7 | 130–180, 200–260, 400–521 | 74 | +| Baofeng UV-S9X3 | `baofeng_uvs9x3` | `UVS9X3` | UVS9X3 | High / Low (0 / 2) | 7 | 130–180, 200–260, 400–521 | 74 | +| Baofeng 5RX | `baofeng_5rx` | `BF5RXRadio` | UVS9X3 | High / Low (0 / 2) | 7 | TX 136–174, 200–260, 400–520; RX also 108–136, 350–390 | 74 | + +CHIRP's aliases: the BF-A58 is also the Rugged RH5X and UV-9R Pro; the BF-A58S +is also the UV-82III. + +**Magics.** The WP970I magic is the A58 one, and the UV-S9X3 magic is the +UV-5R's 291 one, byte for byte. So six of these answer the same magic (and so +does a BF-F8HP), and the UV-S9X3 and 5RX answer the UV-5R's. As with the first +seven, the operator's choice of model decides. + +**What differs from `uv5r.py`:** + +- **Power: we follow Baofeng's programmer here, not CHIRP** (Tim, + 2026-12-02). CHIRP gives six of these High / Med / Low (0 / 1 / 2) with VFO + power in `txpower3` (bits 0–1). Baofeng's WP970I and GT-3WP programmers + offer High / Low, store Low as 1 (CHIRP's Med; a 2 they show as HIGH), and + keep VFO power in bit 7 of VFO+0x17 — the UV-5R's own `txpower` field, which + these six now use. So a channel's Low is 1, Med is written as High, a stored + 2 reads as High, and bits 0–1 of the VFO byte are left as read. The UV-9G's + own programmer lists H, L, M, which would put Mid at 2, but it saves decoded + XML, so that cannot be read; the UV-9G is High / Low with the rest. + The tri-band three (`_tri_band`), which have no vendor programmer to check + against, keep CHIRP's two levels stored as High 0, Low 2 + (`TXPOWER_HIGH` / `TXPOWER_LOW`), and their VFO power the same two bits (key + `vfoa.txpower_hilo`). A 1 read from one of them is shown as High, as CHIRP + intends. +- **Names:** six characters on the UV-82WP and RT6; the seventh cell is left + 0xFF. +- **The 220 band limits** at radio 0x1FCA (`limits.vhf2`), on the tri-band + three. They are inside the band-limit block a settings write already sends. +- **5RX receive-only bands.** CHIRP lists 108–136 and 350–390 among its + `valid_bands` and says nothing about transmit. A channel there is written + receive-only (TX frequency 0xFF, CHIRP's duplex "off"), the safe reading. +- **VFO frequency.** CHIRP's `apply_freq` here writes the eight digits and + leaves the band bit as read, where `uv5r.py` sets it from the frequency. We + set it, the one place we leave this driver on purpose: every radio-authored + image of this class (BF-A58S, 5RX, UV-S9X3, UV-9G) stores VFO B on UHF with + band 1, and the vendor WP970I and GT-3WP programmers write 1 with UHF and + refuse a UHF frequency while the band says VHF. The CHIRP oracle applies the + same correction to CHIRP's output before comparing. +- **Settings** (`gen_schemas.py`): no BCL, alarm code or band-limit TX + enables; backlight timeout is Off / 1–10; the timeout list ends at 600 s; + plus when to send the PTT ID (`settings.pttid`) and the alarm sound. + +**Two CHIRP drivers disagree on DTMF.** CHIRP's UV-S9X3 and 5RX test images +carry firmware `HN5RV011` — the string on which `uv5r.py` switches to the +`0123456789ABCD*#` map. `baofeng_wp970i.py` never switches. The digits agree in +both maps, so on a WP970I-class model with that firmware only digits are used: +a code is read and written only when every character is a digit, and is left +exactly as read otherwise. On any other firmware the usual map applies. + +**Left out, as on the first seven:** CHIRP's `ponmsg`, its FM preset (three +storage methods, picked by what the byte already holds), the service squelch +thresholds, and the read-only firmware / 6+ power-on messages. + +### WP970I class, vendor CPS + +Baofeng's WP970I programmer (the UV-9R download) and GT-3WP programmer are the +same VB6 tool as the UV-82C's (V13.04.13; a blank saved from either is +byte-identical to the UV-82C's), and both carry the ident `WP970I `. Each +opened our image and showed every channel as intended. A re-save after one +edit changed exactly that byte, so the tool normalises nothing else. What it +disagrees with CHIRP on: + +| What | CHIRP `baofeng_wp970i` | Vendor WP970I / GT-3WP CPS | Status | +|---|---|---|---| +| VFO band bit (radio 0x0F1A / 0x0F3A, bit 0) | left as read | set with the band (VFO B to UHF: 0 → 1); UHF frequency refused while band is VHF | **acted on**: we set it. Radio-authored images agree | +| Channel power (byte 14, bits 0–1) | High / Med / Low = 0 / 1 / 2 | HIGH / LOW only; LOW written as 1; a 2 is shown as HIGH | **acted on** (Tim: follow the CPS): High 0, Low 1 on the six two-level models | +| VFO power (radio 0x0F1F / 0x0F3F) | bits 0–1, `txpower3` | bit 7: LOW wrote 0x41 → 0xC1 on VFO A, and the same on VFO B | **acted on**: bit 7 (the UV-5R's `txpower`) on those six; bits 0–1 left as read | + +The UV-9G programmer (PRG-P52UV-GMRS) lists power as H, L, M in that order — +the order that would match stored 0 / 1 / 2 if it lists by index — but it saves +decoded XML, so what it stores cannot be read. None of CHIRP's four +radio-authored images for this class has bit 7 set at 0x0F1F / 0x0F3F, nor a +channel power of 2 on a non-tri-band model, so the power rows rest on the +programmers alone. None of this is confirmed on a radio. + +## Empty slots + +A memory is empty when its **first byte** is 0xFF. Both CHIRP drivers test it +that way. Until this change the family tested all four RX bytes, and CHIRP's +BF-A58S, UV-S9X3 and 5RX images show the difference: a deleted slot there +holds `ff 25 89 25 …`, only byte 0 cleared, and the old test read those as +channels. It affects only the decoded channel list (the download sample and +the read-back table); writes and verification compare raw bytes. None of Tim's +35 UV-5R backups has a slot like that, so on his radio the two tests agree. + ## Identification Each model tries only its own magics, in CHIRP's order. A radio that answers @@ -41,6 +154,20 @@ restore refuses a sibling's backup by that prefix. The image shape is identical, but band limits and power levels mean something else on the other radio. A file with no family prefix (a CHIRP `.img`) is allowed. +**A file CHIRP saved restores too** (`restore_image_for`). CHIRP appends +metadata naming the model it saved the file as; restore drops it, and refuses +the file unless that name is this model's or one of CHIRP's aliases for it +(`Variant::chirp_models`). On the WP970I class, CHIRP's `baofeng_wp970i` layout +(radio 0x0000–0x2000, then the ident) is rearranged into ours, and a file in +that layout without the metadata is refused, since nothing then says which +`baofeng_common` radio it came from. Checked against every `.img` on hand +(`oracle::restore_gate_on_real_files`): each of CHIRP's 5RX, BF-A58S, UV-9G, +UV-S9X3 and UV-5R images is taken by its own model only; the GMRS-V1/V2, +MURS-V1/V2, UV-6R and UV-5G Pro images by none; the app's own UV-5R backups by +the UV-5R only, and every other radio's backup by none. A CHIRP file old +enough to carry no metadata (CHIRP's F-11 image) is still judged on shape +alone, as before. + ## What differs from the UV-5R - **UV-6: no aux block.** The image is 0x1808 bytes. The download opens with @@ -99,9 +226,55 @@ CHIRP offers three things no schema carries: `ponmsg` (above), the 20 service sq thresholds (excluded on purpose, as on the UV-5R) and its "Range Override Parameter" (a CHIRP upload flag, not a radio setting). -**Census still open:** these counts reconcile against what CHIRP exposes, not -against each radio's manual menu list. Counting the manuals' menus, or checking -in the vendor CPS, is the next check. +### Menu census, WP970I class (2026-12-02) + +Against each radio's own manual (transcriptions and sources in +`scratchpad/baofeng_wp970i/manuals/`, gitignored). Three menus are actions, +not settings: MEM-CH, DEL-CH and RESET. + +| Model | Manual | Menus | Settings menus | Reached | Channels only | Not reached | +|---|---|---|---|---|---|---| +| BF-A58 | FCC filing 2AJGM-BFA58 | 42 | 39 | 32 | 4 | BCL, PONMSG, A/B-BP | +| GT-3WP | Baofeng (Radioddity download) | 42 | 39 | 32 | 4 | BCL, PONMSG, A/B-BP | +| RT6 | Retevis (ManualsLib); same text as the GT-3WP's | 42 | 39 | 32 | 4 | BCL, PONMSG, A/B-BP | +| UV-9R | Radioddity's UV-9R manual (T51-EN-V1.1); the GT-3WP's text unnamed | 42 | 39 | 32 | 4 | BCL, PONMSG, A/B-BP | +| UV-9G | FCC filing 2AJGM-UV9G (P52UV) | 42 | 39 | 32 | 4 | BCL, PONMSG, R-TONE | +| 5RX | FCC filing 2AJGM-5RX | 40 (no BAND menu: a key) | 37 | 31 | 4 | BCL, PONMSG | +| BF-A58S, UV-82WP | none found | — | — | — | — | — | +| UV-S9X3 | none of its own; a UV-10R-series manual names it but is dual-band | (40 in that manual) | — | — | — | — | + +- **Reached** (32): SQL, STEP, TXP, SAVE, VOX, W/N, ABR, TDR, BEEP, TOT, VOICE, + ANI, DTMFST, S-CODE, SC-REV, PTT-ID, PTT-LT, MDF-A, MDF-B, AUTOLK, SFT-D, + OFFSET, the three LED colours, AL-MOD, BAND (set from the VFO frequency), + TDR-AB / TX-AB, STE, RP-STE, RPT-RL and ROGER. STEP, TXP, W/N, S-CODE, SFT-D, + OFFSET and BAND are each VFO's settings; TXP and W/N are also every channel's. +- **Channels only** (4): R-DCS, R-CTCS, T-DCS, T-CTCS. Every channel carries its + tones; a VFO's tones are not offered, by CHIRP either. +- **Not reached:** + - BCL. The channel's busy-lock bit is written 0, as on the UV-5R, and CHIRP + offers no global BCL for this class (the UV-5R's byte is not assumed). + - PONMSG. Left out on purpose; the two sources disagree on the index. + - A/B-BP, "tone end of reception" OFF / A / B: in four manuals, in no + CHIRP driver and on no vendor-programmer screen. No address is known. + - R-TONE on the UV-9G (1000 / 1450 / 1750 / 2100 Hz). The UV-82HP's tone + burst has the same options, but nothing puts it at the same address on + this radio, so it is not inferred. +- **Where a manual's options disagree with CHIRP's** (no change made; the radio + decides): the BF-A58's menu 1 is SPACING 12.5 / 25 kHz, and the 5RX's STEP + is 12.5 / 25 only, against CHIRP's eight steps. VOICE is OFF / ON on the + BF-A58 / GT-3WP family and OFF / CHI / ENG on the 5RX and UV-9G. ABR is + OFF / 1–5 s on the BF-A58, against CHIRP's Off / 1–10. +- **Power, per manual:** BF-A58 HIGH / LOW, UV-9G 4 W / 0.5 W, 5RX HIGH only + printed. The GT-3WP / RT6 / UV-9R manual lists **HIGH / MID / LOW (5 / 3 / + 1 W)**, although its own spec table says 5 W / 1 W and the vendor programmer + offers two. Under the vendor encoding now used, that manual's MID would be the + 1 we write for Low. Kept at two levels (Tim, 2026-12-02): the + programmer and the spec table outweigh the menu table, and a Low that turns + out to be MID still transmits below High. +- **Settings with no menu**, offered because CHIRP and the programmer have + them: alarm sound, FM radio, key lock, menu / reset locks, display A / B, + work mode and MR channels, power-on message, band limits, DTMF speeds and + the 15 PTT-ID codes. ## Evidence @@ -110,8 +283,12 @@ in the vendor CPS, is the next check. | CHIRP oracle, memories: a 10–11-memory matrix per model (simplex, ±, split, Tone, TSQL, DTCS N/R, both cross directions, NFM, every power level, lower-case names, NOAA, 223.5 on the X3), on two radio-authored bases. The bases are CHIRP's `Radioddity_UV-5G.img` (`HN5RV011`) and a real UV-5R backup (`BFB251`, for the five models CHIRP never treats as "orig") | byte-identical memory and name arrays, all 7 models, both bases; CHIRP reads ours back as the same memories | | CHIRP oracle, settings: every schema field set to a non-default value through CHIRP's own `get_settings` / `set_settings`, against ours | whole image byte-identical, all 7 models, both bases | | Anchor decode: our decode of CHIRP's radio-authored UV-5G image against CHIRP's decode of it | 41 memories, all equal, under every model | -| Mock radio (`baofeng_uv5r/fake_tests.rs`): magic gating, F8HP's second magic, the UV-6 never asked for aux, a UV-6 settings write sending one block and verifying, a restore skipping CHIRP's calibration gaps | pass | +| Mock radio (`baofeng_uv5r/fake_tests.rs`): magic gating, F8HP's second magic, the UV-6 never asked for aux, a UV-6 settings write sending one block and verifying, a restore skipping CHIRP's calibration gaps; a CHIRP-saved file (wp970i layout or uv5r.py's, with its metadata) restoring as our image, and refused when its metadata names another model or is missing | pass | | Vendor CPS opening our images: Baofeng's UV-82C (V13.04.13), UV-82HP (US2S35) and BF-F8HP (P3, V13.05.10) programmers, from BTECH's official download page, run in a Windows VM. Each loaded our image converted to its `.dat` format (radio 0x0000–0x1E10 as decimal text, 16 bytes a line) | every channel field shown as intended: frequency, offset, split, CTCSS, DCS including inverted polarity, both cross-tone directions, power (MID for Med on the tri-power models), bandwidth. Settings checked on the UV-82C and UV-82HP screens: TOT, squelch, VOX, voice, ABR, work mode, menu / reset, display modes, DTMF side tone, save, scan resume, PTT delay, key / auto lock, BCL, beep, both VFOs in full, LED colours, tail clear, repeater tail, alarm mode, roger, VFO/MR, single PTT, TDR, TDR TX side, all 15 PTT-ID codes, DTMF speeds, ANI code and ANI ID. Two disagreements, both acted on: names (upper case only) and `ponmsg` (index reversed). The `.dat` carries no aux block, so the power-on message and band limits could not be checked this way; the UV-82HP programmer has no tone-burst field, so `tdrch` is CHIRP's alone | +| **WP970I class**, CHIRP oracle (`baofeng_wp970i.py`): the same matrix plus 223.5 MHz on the tri-band three, and 121.5 / 360 MHz on the 5RX; every schema field set to a non-default value. Run on all four of CHIRP's radio-authored images for this driver (BF-A58S, UV-9G, UV-S9X3 and 5RX, converted to our layout) and on a real UV-5R backup | byte-identical memory and name arrays and whole settings images, all 9 models, all 6 bases (the four, CHIRP's UV-5G image and the real backup), after three translations where we follow the vendor programmer: the VFO band bit, and on the six two-level models channel Low as 1 and VFO power in bit 7 (bits 0–1 then held as read). CHIRP reads our memories back as given. The original seven and the UV-5R match on the real backup; on CHIRP's images the UV-5R differs only in the VFO step byte, which our encoder leaves alone when the image's firmware has the other step list (as on `main`) | +| WP970I class, anchor decode: our decode of each CHIRP image against CHIRP's | 22 memories (BF-A58S, UV-S9X3, 5RX images) and 65 (UV-9G), all equal under every model (CHIRP's power labels translated to the vendor programmer's on the six two-level models). This is what found the empty-slot rule above. Under the tri-band classes CHIRP cannot decode 7 of the UV-9G image's memories (Med power it has no level for; CHIRP's own error path then fails), so those are skipped | +| WP970I class, mock radio: the UV-9G refusing a WP970I radio; a BF-A58S settings write reaching the 220 limits, VFO Low as 2 and PTT ID, and verifying; digits-only DTMF on HN5RV01 | pass | +| WP970I class, vendor CPS: Baofeng's WP970I programmer (from the UV-9R download, V13.04.13) and GT-3WP programmer, run in the VM, each opening our UV-9R / GT-3WP image as `.dat`; the UV-9G's (PRG-P52UV-GMRS V2.5, .NET) saves decoded XML, so it is not a byte oracle | channels: frequency, offset, split, CTCSS, DCS both polarities, both cross directions, bandwidth and names as intended (names shown A–Z0–9, as on the UV-82C). Settings screen as intended except the VFOs. Three disagreements, below | | Hardware ladder | **skipped: nobody here owns one** | The oracle proves the port matches CHIRP. It cannot show that CHIRP's map is diff --git a/scripts/baofeng_uv5r_family/chirp_oracle.py b/scripts/baofeng_uv5r_family/chirp_oracle.py index 93cb7ca..54ec14a 100644 --- a/scripts/baofeng_uv5r_family/chirp_oracle.py +++ b/scripts/baofeng_uv5r_family/chirp_oracle.py @@ -24,7 +24,9 @@ from chirp import memmap, chirp_common from chirp.settings import RadioSetting, RadioSettingValueList, RadioSettingValueBoolean, \ RadioSettingValueInteger, RadioSettingValueString -from chirp.drivers import uv5r +from chirp.drivers import uv5r, baofeng_wp970i + +MODULES = {'uv5r': uv5r, 'baofeng_wp970i': baofeng_wp970i} KEYMAP = { # ours -> CHIRP setting name 'limits.vhf.lower': 'limits_new.vhf.lower', 'limits.vhf.upper': 'limits_new.vhf.upper', @@ -33,13 +35,49 @@ } +# The WP970I class's CHIRP image is radio 0x0000-0x2000 followed by the ident; +# ours is the ident, the main block, then the aux block from 0x1EC0 (the same +# bytes uv5r.py keeps). Neither driver maps 0x1800-0x1EC0, so it is filled. +def wp(cls): + return issubclass(cls, baofeng_wp970i.WP970I) + + +def to_chirp(cls, img): + if not wp(cls): + return bytes(img) + radio_ = bytearray(b'\xff' * 0x2000) + radio_[0:0x1800] = img[8:0x1808] + radio_[0x1EC0:0x2000] = img[0x1808:0x1948] + return bytes(radio_) + bytes(img[0:8]) + + +def from_chirp(cls, data): + if not wp(cls): + return data + return data[0x2000:0x2008] + data[0:0x1800] + data[0x1EC0:0x2000] + + def radio(cls, img): r = cls(None) - r._mmap = memmap.MemoryMapBytes(bytes(img)) + r._mmap = memmap.MemoryMapBytes(to_chirp(cls, img)) r.process_mmap() return r +def packed(cls, r): + return from_chirp(cls, r.get_mmap().get_packed()) + + +def chirp_name(key, by_name): + """Our key as CHIRP names it: uv5r.py mostly bare, wp970i under `settings.` + and `vfo.a.`.""" + alt = key.replace('vfoa.', 'vfo.a.').replace('vfob.', 'vfo.b.').replace('txpower_hilo', 'txpower3') + for n in (KEYMAP.get(key, key), 'settings.' + key, alt): + if n in by_name: + return n + return KEYMAP.get(key, key) + + def walk(group): for el in group: if isinstance(el, RadioSetting): @@ -60,6 +98,19 @@ def diff(a, b, lo, hi, label): return len(out) +# Where we follow Baofeng's WP970I / GT-3WP programmers instead of CHIRP +# (`cps_power`, Tim 2026-12-02): they have two channel levels with LOW stored +# as 1, which CHIRP calls Med, and a 2 shows as HIGH; and VFO power is bit 7 of +# VFO+0x17 (CHIRP's `unused5`), not `txpower3`. The oracle translates those two +# and compares every other byte with CHIRP as before. +OURS_TO_CHIRP = {'High': 'High', 'Low': 'Med'} +CHIRP_TO_OURS = {'High': 'High', 'Med': 'Low', 'Low': 'High'} + + +def cps_power(d): + return json.load(open(os.path.join(d, 'settings.json'))).get('cps_power', False) + + def channels(d, cls): base = open(os.path.join(d, 'base.bin'), 'rb').read() ours = open(os.path.join(d, 'ours.bin'), 'rb').read() @@ -67,6 +118,8 @@ def channels(d, cls): r = radio(cls, base) rf = r.get_features() levels = {str(p): p for p in rf.valid_power_levels} + if cps_power(d): + levels = {o: levels[c] for o, c in OURS_TO_CHIRP.items()} first = rf.memory_bounds[0] for e in matrix: m = chirp_common.Memory() @@ -77,13 +130,14 @@ def channels(d, cls): m.cross_mode = e['cross_mode']; m.mode = e['mode'] m.power = levels[e['power']]; m.name = e['name'] r.set_memory(m) - theirs = r.get_mmap().get_packed() + theirs = packed(cls, r) bad = diff(ours, theirs, 0x0008, 0x0808, 'memories') + diff(ours, theirs, 0x1008, 0x1808, 'names') # And CHIRP reads our bytes back as the memories it was given. rr = radio(cls, ours) for e in matrix: m = rr.get_memory(e['number'] + first) - if m.freq != e['freq'] or m.name != e['name'].rstrip(): + want = e['name'][:getattr(cls, 'LENGTH_NAME', 7)].rstrip() + if m.freq != e['freq'] or m.name != want: bad += 1 print(f" readback mem {e['number']}: {m.freq} {m.name!r} != {e['freq']} {e['name']!r}") return len(matrix), bad @@ -96,10 +150,21 @@ def anchor(d, cls): r = radio(cls, img) first = r.get_features().memory_bounds[0] theirs = {} + undecodable = [] for n in range(128): - m = r.get_memory(n + first) + try: + m = r.get_memory(n + first) + except Exception as e: # CHIRP's own error path can fail (bad power level) + undecodable.append(n) + continue if not m.empty: + if cps_power(d): + m.power = CHIRP_TO_OURS[str(m.power)] theirs[n] = m + if undecodable: + print(f" anchor: CHIRP could not decode slots {undecodable} under this class; skipped") + for n in undecodable: + ours.pop(n, None) bad = 0 if set(ours) != set(theirs): bad += 1 @@ -121,17 +186,21 @@ def settings(d, cls): by_name = {s.get_name(): s for s in walk(groups)} applied, missing = 0, [] for key, val in spec['values'].items(): - name = KEYMAP.get(key, key) + name = chirp_name(key, by_name) if name not in by_name and name.startswith('limits_new.'): # Pre-BFB291 firmware: CHIRP offers the old band-limit block. name = 'limits_old.' + name[len('limits_new.'):] s = by_name.get(name) + if cps_power(d) and key in ('vfoa.txpower', 'vfob.txpower'): + continue # bit 7, set below; CHIRP has no such setting here if s is None: missing.append(key) continue v = s.value if isinstance(v, RadioSettingValueBoolean): v.set_value(bool(val)) + elif isinstance(v, RadioSettingValueList) and isinstance(val, int): + v.set_index(val) # ours an integer, CHIRP's an Off/1-9 list elif isinstance(v, RadioSettingValueList): v.set_value(val) elif isinstance(v, RadioSettingValueInteger): @@ -145,10 +214,30 @@ def settings(d, cls): for s in by_name.values(): if s.value.get_value() is None and s.value.get_mutable(): s.value.set_mutable(False) + # Under cps_power we do not offer CHIRP's `txpower3` (bits 0-1), so we + # leave those bits as read; CHIRP would rewrite a 3 it cannot show as 2. + if cps_power(d): + for n in ('vfo.a.txpower3', 'vfo.b.txpower3'): + if n in by_name: + by_name[n].value.set_mutable(False) r.set_settings(groups) - theirs = r.get_mmap().get_packed() + if wp(cls): + # The one place we leave CHIRP on purpose: baofeng_wp970i's apply_freq + # writes a VFO's digits and leaves its band bit as read. The radio- + # authored images (BF-A58S, 5RX, UV-S9X3, UV-9G: VFO B on UHF, band 1) + # and the vendor WP970I / GT-3WP CPS set it with the band, as uv5r.py + # does; so do we, and so does this oracle. + for vfo in (r._memobj.vfo.a, r._memobj.vfo.b): + vfo.band = int(''.join(str(int(x)) for x in vfo.freq)) >= 40000000 + if cps_power(d): + for side, vfo in (('a', r._memobj.vfo.a), ('b', r._memobj.vfo.b)): + want = spec['values'].get('vfo%s.txpower' % side) + if want is not None: + vfo.unused5 = want == 'Low' + applied += want is not None + theirs = packed(cls, r) bad = diff(ours, theirs, 0, len(ours), 'settings image') - asked = {KEYMAP.get(k, k) for k in spec['values']} + asked = {chirp_name(k, by_name) for k in spec['values']} asked |= {'limits_old.' + n[len('limits_new.'):] for n in asked if n.startswith('limits_new.')} chirp_only = sorted(n for n in by_name if n not in asked and by_name[n].value.get_mutable()) return applied, missing, chirp_only, bad @@ -160,7 +249,8 @@ def main(): total_bad = 0 for key in keys: kd = os.path.join(d, key) - cls = getattr(uv5r, json.load(open(os.path.join(kd, 'settings.json')))['class']) + spec = json.load(open(os.path.join(kd, 'settings.json'))) + cls = getattr(MODULES[spec.get('module', 'uv5r')], spec['class']) print(f"== {key} ({cls.VENDOR} {cls.MODEL})") n, bad = channels(kd, cls) print(f" memories: {n}, {bad} differing bytes/readbacks") diff --git a/scripts/baofeng_uv5r_family/gen_schemas.py b/scripts/baofeng_uv5r_family/gen_schemas.py index 5cf0f8a..ec382c8 100644 --- a/scripts/baofeng_uv5r_family/gen_schemas.py +++ b/scripts/baofeng_uv5r_family/gen_schemas.py @@ -25,6 +25,26 @@ before it for an image without the aux block); the autolk byte is VOX on/off, Dual Watch TX Priority is a boolean, plus a dual-watch channel and alarm sound. +The WP970I class (`baofeng_wp970i.py` on `baofeng_common.py`: BF-A58, +UV-82WP, GT-3WP, RT6, BF-A58S, UV-S9X3, 5RX, UV-9R, UV-9G) has the UV-5R's +radio map, and its `get_settings` differs from `uv5r.py`'s as follows: + + * no Busy Channel Lockout, alarm code or band-limit TX enables; + * backlight timeout is a list, Off / 1-10, not 0-24; + * the timeout list stops at 600 s (no "Off"); + * when to send the PTT ID (`settings.pttid`, Off / BOT / EOT / Both) and the + alarm sound; + * VFO power: CHIRP has `txpower3` (bits 0-1) on every model. Baofeng's + WP970I and GT-3WP programmers store it in bit 7 instead (High / Low; LOW + turned 0x41 into 0xC1 on each VFO), which is the UV-5R's own `txpower` + field, so the six two-level models keep that field (Tim, 2026-12-02: + follow the CPS). The tri-band models (`_tri_band`), which have no vendor + programmer to check against, keep CHIRP's High / Low stored as 0 / 2; + * the tri-band models' 220 band limits (`limits.vhf2`); + * CHIRP's FM preset is left out (three storage methods, chosen by what the + byte already holds), as are its service squelch thresholds, the read-only + firmware messages, and `ponmsg` (unsettled, as above). + Every key it emits must resolve in `baofeng_uv5r/settings.rs`'s `loc()`; the `family_schemas_only_name_keys_the_encoder_knows` test holds that. @@ -138,6 +158,37 @@ def uv6(schema): return drop_empty_sections(schema) +TIMEOUT40 = ["%d sec" % x for x in range(15, 615, 15)] +OFF1TO10 = ["Off"] + [str(x) for x in range(1, 11)] +PTTID = ["Off", "BOT", "EOT", "Both"] + + +def wp970i(schema): + drop(schema, "bcl", "ani.alarmcode", "limits.vhf.enable", "limits.uhf.enable") + f = field(schema, "abr") + f.update({"label": "Backlight Timeout", "type": "select", "options": OFF1TO10}) + del f["min"], f["max"] + field(schema, "timeout")["options"] = TIMEOUT40 + insert_after(schema, "dtmfst", {"key": "pttid", "label": "When to send PTT ID", "type": "select", + "options": PTTID}) + insert_after(schema, "almod", {"key": "alarm", "label": "Alarm Sound", "type": "boolean"}) + + +def tri_band(schema): + for side in ("a", "b"): + f = field(schema, "vfo%s.txpower" % side) + f["key"] = "vfo%s.txpower_hilo" % side + f["options"] = ["High", "Low"] + insert_after(schema, "limits.vhf.upper", + {"key": "limits.vhf2.lower", "label": "220 Lower Limit (MHz)", "type": "integer", + "min": 1, "max": 1000}, + {"key": "limits.vhf2.upper", "label": "220 Upper Limit (MHz)", "type": "integer", + "min": 1, "max": 1000}) + + +WP970I_2 = [not_orig, wp970i] +WP970I_TRI = [not_orig, wp970i, tri_band] + MODELS = { "uv82": [not_orig, uv82_extras], "uv82x3": [not_orig, uv82_extras], @@ -146,6 +197,15 @@ def uv6(schema): "gt5r": [not_orig], "uv5g": [not_orig], "uv6": [not_orig, uv6], + "bfa58": WP970I_2, + "uv82wp": WP970I_2, + "gt3wp": WP970I_2, + "rt6": WP970I_2, + "uv9r": WP970I_2, + "uv9g": WP970I_2, + "bfa58s": WP970I_TRI, + "uvs9x3": WP970I_TRI, + "5rx": WP970I_TRI, } diff --git a/src-tauri/src/5rx_settings_schema.json b/src-tauri/src/5rx_settings_schema.json new file mode 100644 index 0000000..6171ca2 --- /dev/null +++ b/src-tauri/src/5rx_settings_schema.json @@ -0,0 +1,1125 @@ +[ + { + "key": "section-general", + "label": "General", + "type": "section", + "group": "General" + }, + { + "key": "save", + "label": "Battery Saver", + "type": "select", + "options": [ + "Off", + "1:1", + "1:2", + "1:3", + "1:4" + ] + }, + { + "key": "autolk", + "label": "Automatic Key Lock", + "type": "boolean" + }, + { + "key": "keylock", + "label": "Keypad Lock", + "type": "boolean" + }, + { + "key": "almod", + "label": "Alarm Mode", + "type": "select", + "options": [ + "Site", + "Tone", + "Code" + ] + }, + { + "key": "alarm", + "label": "Alarm Sound", + "type": "boolean" + }, + { + "key": "fmradio", + "label": "Broadcast FM Radio", + "type": "boolean" + }, + { + "key": "reset", + "label": "RESET Menu Enabled", + "type": "boolean" + }, + { + "key": "menu", + "label": "All Menus Enabled", + "type": "boolean" + }, + { + "key": "section-display", + "label": "Display", + "type": "section", + "group": "Display" + }, + { + "key": "abr", + "label": "Backlight Timeout", + "type": "select", + "options": [ + "Off", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "mdfa", + "label": "Display Mode (A)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "mdfb", + "label": "Display Mode (B)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "displayab", + "label": "Display Side", + "type": "select", + "options": [ + "A", + "B" + ] + }, + { + "key": "wtled", + "label": "Standby LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "rxled", + "label": "RX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "txled", + "label": "TX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "poweron_msg.line1", + "label": "Power-On Message Line 1", + "type": "text", + "max_length": 7 + }, + { + "key": "poweron_msg.line2", + "label": "Power-On Message Line 2", + "type": "text", + "max_length": 7 + }, + { + "key": "section-sounds", + "label": "Sounds", + "type": "section", + "group": "Sounds" + }, + { + "key": "beep", + "label": "Key Beep", + "type": "boolean" + }, + { + "key": "roger", + "label": "Roger Beep", + "type": "boolean" + }, + { + "key": "voice", + "label": "Voice Prompt", + "type": "select", + "options": [ + "Off", + "English", + "Chinese" + ] + }, + { + "key": "section-transmit-and-receive", + "label": "Transmit & Receive", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "squelch", + "label": "Carrier Squelch Level", + "type": "integer", + "min": 0, + "max": 9 + }, + { + "key": "timeout", + "label": "Timeout Timer", + "type": "select", + "options": [ + "15 sec", + "30 sec", + "45 sec", + "60 sec", + "75 sec", + "90 sec", + "105 sec", + "120 sec", + "135 sec", + "150 sec", + "165 sec", + "180 sec", + "195 sec", + "210 sec", + "225 sec", + "240 sec", + "255 sec", + "270 sec", + "285 sec", + "300 sec", + "315 sec", + "330 sec", + "345 sec", + "360 sec", + "375 sec", + "390 sec", + "405 sec", + "420 sec", + "435 sec", + "450 sec", + "465 sec", + "480 sec", + "495 sec", + "510 sec", + "525 sec", + "540 sec", + "555 sec", + "570 sec", + "585 sec", + "600 sec" + ] + }, + { + "key": "vox", + "label": "VOX Sensitivity", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "tdr", + "label": "Dual Watch", + "type": "boolean" + }, + { + "key": "tdrab", + "label": "Dual Watch TX Priority", + "type": "select", + "options": [ + "Off", + "A", + "B" + ] + }, + { + "key": "ste", + "label": "Squelch Tail Eliminate (HT to HT)", + "type": "boolean" + }, + { + "key": "rpste", + "label": "Squelch Tail Eliminate (repeater)", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "rptrl", + "label": "STE Repeater Delay", + "type": "select", + "options": [ + "OFF", + "100 ms", + "200 ms", + "300 ms", + "400 ms", + "500 ms", + "600 ms", + "700 ms", + "800 ms", + "900 ms", + "1000 ms" + ] + }, + { + "key": "section-band-limits", + "label": "Band Limits", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "limits.vhf.lower", + "label": "VHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf.upper", + "label": "VHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf2.lower", + "label": "220 Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf2.upper", + "label": "220 Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.lower", + "label": "UHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.upper", + "label": "UHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "section-memory-and-vfo", + "label": "Memory & VFO", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "workmode", + "label": "VFO/MR Mode", + "type": "select", + "options": [ + "Frequency", + "Channel" + ] + }, + { + "key": "wmchannel.mrcha", + "label": "MR A Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "wmchannel.mrchb", + "label": "MR B Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "section-vfo", + "label": "VFO A / B", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "vfoa.freq", + "label": "VFO A Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.freq", + "label": "VFO B Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.sftd", + "label": "VFO A Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfob.sftd", + "label": "VFO B Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfoa.offset", + "label": "VFO A Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.offset", + "label": "VFO B Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.txpower_hilo", + "label": "VFO A Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfob.txpower_hilo", + "label": "VFO B Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfoa.widenarr", + "label": "VFO A Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfob.widenarr", + "label": "VFO B Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfoa.scode", + "label": "VFO A PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfob.scode", + "label": "VFO B PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfoa.step", + "label": "VFO A Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "vfob.step", + "label": "VFO B Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "section-scan", + "label": "Scan", + "type": "section", + "group": "Scan" + }, + { + "key": "screv", + "label": "Scan Resume", + "type": "select", + "options": [ + "TO", + "CO", + "SE" + ] + }, + { + "key": "section-dtmf", + "label": "DTMF & ANI", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "dtmfst", + "label": "DTMF Sidetone", + "type": "select", + "options": [ + "OFF", + "DT-ST", + "ANI-ST", + "DT+ANI" + ] + }, + { + "key": "pttid", + "label": "When to send PTT ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "ani.dtmfon", + "label": "DTMF Speed (on)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "ani.dtmfoff", + "label": "DTMF Speed (off)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "pttlt", + "label": "PTT ID Delay", + "type": "integer", + "min": 0, + "max": 50 + }, + { + "key": "ani.code", + "label": "ANI Code", + "type": "text", + "max_length": 5 + }, + { + "key": "ani.aniid", + "label": "ANI ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "section-ptt-id-codes", + "label": "PTT ID Codes", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "pttid/0.code", + "label": "PTT ID Code 1", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/1.code", + "label": "PTT ID Code 2", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/2.code", + "label": "PTT ID Code 3", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/3.code", + "label": "PTT ID Code 4", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/4.code", + "label": "PTT ID Code 5", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/5.code", + "label": "PTT ID Code 6", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/6.code", + "label": "PTT ID Code 7", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/7.code", + "label": "PTT ID Code 8", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/8.code", + "label": "PTT ID Code 9", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/9.code", + "label": "PTT ID Code 10", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/10.code", + "label": "PTT ID Code 11", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/11.code", + "label": "PTT ID Code 12", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/12.code", + "label": "PTT ID Code 13", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/13.code", + "label": "PTT ID Code 14", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/14.code", + "label": "PTT ID Code 15", + "type": "text", + "max_length": 5 + } +] diff --git a/src-tauri/src/bfa58_settings_schema.json b/src-tauri/src/bfa58_settings_schema.json new file mode 100644 index 0000000..3210dc0 --- /dev/null +++ b/src-tauri/src/bfa58_settings_schema.json @@ -0,0 +1,1111 @@ +[ + { + "key": "section-general", + "label": "General", + "type": "section", + "group": "General" + }, + { + "key": "save", + "label": "Battery Saver", + "type": "select", + "options": [ + "Off", + "1:1", + "1:2", + "1:3", + "1:4" + ] + }, + { + "key": "autolk", + "label": "Automatic Key Lock", + "type": "boolean" + }, + { + "key": "keylock", + "label": "Keypad Lock", + "type": "boolean" + }, + { + "key": "almod", + "label": "Alarm Mode", + "type": "select", + "options": [ + "Site", + "Tone", + "Code" + ] + }, + { + "key": "alarm", + "label": "Alarm Sound", + "type": "boolean" + }, + { + "key": "fmradio", + "label": "Broadcast FM Radio", + "type": "boolean" + }, + { + "key": "reset", + "label": "RESET Menu Enabled", + "type": "boolean" + }, + { + "key": "menu", + "label": "All Menus Enabled", + "type": "boolean" + }, + { + "key": "section-display", + "label": "Display", + "type": "section", + "group": "Display" + }, + { + "key": "abr", + "label": "Backlight Timeout", + "type": "select", + "options": [ + "Off", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "mdfa", + "label": "Display Mode (A)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "mdfb", + "label": "Display Mode (B)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "displayab", + "label": "Display Side", + "type": "select", + "options": [ + "A", + "B" + ] + }, + { + "key": "wtled", + "label": "Standby LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "rxled", + "label": "RX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "txled", + "label": "TX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "poweron_msg.line1", + "label": "Power-On Message Line 1", + "type": "text", + "max_length": 7 + }, + { + "key": "poweron_msg.line2", + "label": "Power-On Message Line 2", + "type": "text", + "max_length": 7 + }, + { + "key": "section-sounds", + "label": "Sounds", + "type": "section", + "group": "Sounds" + }, + { + "key": "beep", + "label": "Key Beep", + "type": "boolean" + }, + { + "key": "roger", + "label": "Roger Beep", + "type": "boolean" + }, + { + "key": "voice", + "label": "Voice Prompt", + "type": "select", + "options": [ + "Off", + "English", + "Chinese" + ] + }, + { + "key": "section-transmit-and-receive", + "label": "Transmit & Receive", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "squelch", + "label": "Carrier Squelch Level", + "type": "integer", + "min": 0, + "max": 9 + }, + { + "key": "timeout", + "label": "Timeout Timer", + "type": "select", + "options": [ + "15 sec", + "30 sec", + "45 sec", + "60 sec", + "75 sec", + "90 sec", + "105 sec", + "120 sec", + "135 sec", + "150 sec", + "165 sec", + "180 sec", + "195 sec", + "210 sec", + "225 sec", + "240 sec", + "255 sec", + "270 sec", + "285 sec", + "300 sec", + "315 sec", + "330 sec", + "345 sec", + "360 sec", + "375 sec", + "390 sec", + "405 sec", + "420 sec", + "435 sec", + "450 sec", + "465 sec", + "480 sec", + "495 sec", + "510 sec", + "525 sec", + "540 sec", + "555 sec", + "570 sec", + "585 sec", + "600 sec" + ] + }, + { + "key": "vox", + "label": "VOX Sensitivity", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "tdr", + "label": "Dual Watch", + "type": "boolean" + }, + { + "key": "tdrab", + "label": "Dual Watch TX Priority", + "type": "select", + "options": [ + "Off", + "A", + "B" + ] + }, + { + "key": "ste", + "label": "Squelch Tail Eliminate (HT to HT)", + "type": "boolean" + }, + { + "key": "rpste", + "label": "Squelch Tail Eliminate (repeater)", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "rptrl", + "label": "STE Repeater Delay", + "type": "select", + "options": [ + "OFF", + "100 ms", + "200 ms", + "300 ms", + "400 ms", + "500 ms", + "600 ms", + "700 ms", + "800 ms", + "900 ms", + "1000 ms" + ] + }, + { + "key": "section-band-limits", + "label": "Band Limits", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "limits.vhf.lower", + "label": "VHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf.upper", + "label": "VHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.lower", + "label": "UHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.upper", + "label": "UHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "section-memory-and-vfo", + "label": "Memory & VFO", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "workmode", + "label": "VFO/MR Mode", + "type": "select", + "options": [ + "Frequency", + "Channel" + ] + }, + { + "key": "wmchannel.mrcha", + "label": "MR A Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "wmchannel.mrchb", + "label": "MR B Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "section-vfo", + "label": "VFO A / B", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "vfoa.freq", + "label": "VFO A Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.freq", + "label": "VFO B Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.sftd", + "label": "VFO A Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfob.sftd", + "label": "VFO B Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfoa.offset", + "label": "VFO A Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.offset", + "label": "VFO B Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.txpower", + "label": "VFO A Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfob.txpower", + "label": "VFO B Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfoa.widenarr", + "label": "VFO A Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfob.widenarr", + "label": "VFO B Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfoa.scode", + "label": "VFO A PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfob.scode", + "label": "VFO B PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfoa.step", + "label": "VFO A Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "vfob.step", + "label": "VFO B Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "section-scan", + "label": "Scan", + "type": "section", + "group": "Scan" + }, + { + "key": "screv", + "label": "Scan Resume", + "type": "select", + "options": [ + "TO", + "CO", + "SE" + ] + }, + { + "key": "section-dtmf", + "label": "DTMF & ANI", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "dtmfst", + "label": "DTMF Sidetone", + "type": "select", + "options": [ + "OFF", + "DT-ST", + "ANI-ST", + "DT+ANI" + ] + }, + { + "key": "pttid", + "label": "When to send PTT ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "ani.dtmfon", + "label": "DTMF Speed (on)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "ani.dtmfoff", + "label": "DTMF Speed (off)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "pttlt", + "label": "PTT ID Delay", + "type": "integer", + "min": 0, + "max": 50 + }, + { + "key": "ani.code", + "label": "ANI Code", + "type": "text", + "max_length": 5 + }, + { + "key": "ani.aniid", + "label": "ANI ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "section-ptt-id-codes", + "label": "PTT ID Codes", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "pttid/0.code", + "label": "PTT ID Code 1", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/1.code", + "label": "PTT ID Code 2", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/2.code", + "label": "PTT ID Code 3", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/3.code", + "label": "PTT ID Code 4", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/4.code", + "label": "PTT ID Code 5", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/5.code", + "label": "PTT ID Code 6", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/6.code", + "label": "PTT ID Code 7", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/7.code", + "label": "PTT ID Code 8", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/8.code", + "label": "PTT ID Code 9", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/9.code", + "label": "PTT ID Code 10", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/10.code", + "label": "PTT ID Code 11", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/11.code", + "label": "PTT ID Code 12", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/12.code", + "label": "PTT ID Code 13", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/13.code", + "label": "PTT ID Code 14", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/14.code", + "label": "PTT ID Code 15", + "type": "text", + "max_length": 5 + } +] diff --git a/src-tauri/src/bfa58s_settings_schema.json b/src-tauri/src/bfa58s_settings_schema.json new file mode 100644 index 0000000..6171ca2 --- /dev/null +++ b/src-tauri/src/bfa58s_settings_schema.json @@ -0,0 +1,1125 @@ +[ + { + "key": "section-general", + "label": "General", + "type": "section", + "group": "General" + }, + { + "key": "save", + "label": "Battery Saver", + "type": "select", + "options": [ + "Off", + "1:1", + "1:2", + "1:3", + "1:4" + ] + }, + { + "key": "autolk", + "label": "Automatic Key Lock", + "type": "boolean" + }, + { + "key": "keylock", + "label": "Keypad Lock", + "type": "boolean" + }, + { + "key": "almod", + "label": "Alarm Mode", + "type": "select", + "options": [ + "Site", + "Tone", + "Code" + ] + }, + { + "key": "alarm", + "label": "Alarm Sound", + "type": "boolean" + }, + { + "key": "fmradio", + "label": "Broadcast FM Radio", + "type": "boolean" + }, + { + "key": "reset", + "label": "RESET Menu Enabled", + "type": "boolean" + }, + { + "key": "menu", + "label": "All Menus Enabled", + "type": "boolean" + }, + { + "key": "section-display", + "label": "Display", + "type": "section", + "group": "Display" + }, + { + "key": "abr", + "label": "Backlight Timeout", + "type": "select", + "options": [ + "Off", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "mdfa", + "label": "Display Mode (A)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "mdfb", + "label": "Display Mode (B)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "displayab", + "label": "Display Side", + "type": "select", + "options": [ + "A", + "B" + ] + }, + { + "key": "wtled", + "label": "Standby LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "rxled", + "label": "RX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "txled", + "label": "TX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "poweron_msg.line1", + "label": "Power-On Message Line 1", + "type": "text", + "max_length": 7 + }, + { + "key": "poweron_msg.line2", + "label": "Power-On Message Line 2", + "type": "text", + "max_length": 7 + }, + { + "key": "section-sounds", + "label": "Sounds", + "type": "section", + "group": "Sounds" + }, + { + "key": "beep", + "label": "Key Beep", + "type": "boolean" + }, + { + "key": "roger", + "label": "Roger Beep", + "type": "boolean" + }, + { + "key": "voice", + "label": "Voice Prompt", + "type": "select", + "options": [ + "Off", + "English", + "Chinese" + ] + }, + { + "key": "section-transmit-and-receive", + "label": "Transmit & Receive", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "squelch", + "label": "Carrier Squelch Level", + "type": "integer", + "min": 0, + "max": 9 + }, + { + "key": "timeout", + "label": "Timeout Timer", + "type": "select", + "options": [ + "15 sec", + "30 sec", + "45 sec", + "60 sec", + "75 sec", + "90 sec", + "105 sec", + "120 sec", + "135 sec", + "150 sec", + "165 sec", + "180 sec", + "195 sec", + "210 sec", + "225 sec", + "240 sec", + "255 sec", + "270 sec", + "285 sec", + "300 sec", + "315 sec", + "330 sec", + "345 sec", + "360 sec", + "375 sec", + "390 sec", + "405 sec", + "420 sec", + "435 sec", + "450 sec", + "465 sec", + "480 sec", + "495 sec", + "510 sec", + "525 sec", + "540 sec", + "555 sec", + "570 sec", + "585 sec", + "600 sec" + ] + }, + { + "key": "vox", + "label": "VOX Sensitivity", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "tdr", + "label": "Dual Watch", + "type": "boolean" + }, + { + "key": "tdrab", + "label": "Dual Watch TX Priority", + "type": "select", + "options": [ + "Off", + "A", + "B" + ] + }, + { + "key": "ste", + "label": "Squelch Tail Eliminate (HT to HT)", + "type": "boolean" + }, + { + "key": "rpste", + "label": "Squelch Tail Eliminate (repeater)", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "rptrl", + "label": "STE Repeater Delay", + "type": "select", + "options": [ + "OFF", + "100 ms", + "200 ms", + "300 ms", + "400 ms", + "500 ms", + "600 ms", + "700 ms", + "800 ms", + "900 ms", + "1000 ms" + ] + }, + { + "key": "section-band-limits", + "label": "Band Limits", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "limits.vhf.lower", + "label": "VHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf.upper", + "label": "VHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf2.lower", + "label": "220 Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf2.upper", + "label": "220 Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.lower", + "label": "UHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.upper", + "label": "UHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "section-memory-and-vfo", + "label": "Memory & VFO", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "workmode", + "label": "VFO/MR Mode", + "type": "select", + "options": [ + "Frequency", + "Channel" + ] + }, + { + "key": "wmchannel.mrcha", + "label": "MR A Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "wmchannel.mrchb", + "label": "MR B Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "section-vfo", + "label": "VFO A / B", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "vfoa.freq", + "label": "VFO A Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.freq", + "label": "VFO B Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.sftd", + "label": "VFO A Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfob.sftd", + "label": "VFO B Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfoa.offset", + "label": "VFO A Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.offset", + "label": "VFO B Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.txpower_hilo", + "label": "VFO A Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfob.txpower_hilo", + "label": "VFO B Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfoa.widenarr", + "label": "VFO A Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfob.widenarr", + "label": "VFO B Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfoa.scode", + "label": "VFO A PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfob.scode", + "label": "VFO B PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfoa.step", + "label": "VFO A Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "vfob.step", + "label": "VFO B Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "section-scan", + "label": "Scan", + "type": "section", + "group": "Scan" + }, + { + "key": "screv", + "label": "Scan Resume", + "type": "select", + "options": [ + "TO", + "CO", + "SE" + ] + }, + { + "key": "section-dtmf", + "label": "DTMF & ANI", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "dtmfst", + "label": "DTMF Sidetone", + "type": "select", + "options": [ + "OFF", + "DT-ST", + "ANI-ST", + "DT+ANI" + ] + }, + { + "key": "pttid", + "label": "When to send PTT ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "ani.dtmfon", + "label": "DTMF Speed (on)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "ani.dtmfoff", + "label": "DTMF Speed (off)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "pttlt", + "label": "PTT ID Delay", + "type": "integer", + "min": 0, + "max": 50 + }, + { + "key": "ani.code", + "label": "ANI Code", + "type": "text", + "max_length": 5 + }, + { + "key": "ani.aniid", + "label": "ANI ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "section-ptt-id-codes", + "label": "PTT ID Codes", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "pttid/0.code", + "label": "PTT ID Code 1", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/1.code", + "label": "PTT ID Code 2", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/2.code", + "label": "PTT ID Code 3", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/3.code", + "label": "PTT ID Code 4", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/4.code", + "label": "PTT ID Code 5", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/5.code", + "label": "PTT ID Code 6", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/6.code", + "label": "PTT ID Code 7", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/7.code", + "label": "PTT ID Code 8", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/8.code", + "label": "PTT ID Code 9", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/9.code", + "label": "PTT ID Code 10", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/10.code", + "label": "PTT ID Code 11", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/11.code", + "label": "PTT ID Code 12", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/12.code", + "label": "PTT ID Code 13", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/13.code", + "label": "PTT ID Code 14", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/14.code", + "label": "PTT ID Code 15", + "type": "text", + "max_length": 5 + } +] diff --git a/src-tauri/src/commands/program.rs b/src-tauri/src/commands/program.rs index 5d94bae..b4435cc 100644 --- a/src-tauri/src/commands/program.rs +++ b/src-tauri/src/commands/program.rs @@ -1517,7 +1517,7 @@ where None => restorer.restore_image(&port, &image)?, } Ok(RestoreResult { - bytes: image.len(), + bytes: restorer.restore_len(&image), source: path, }) }) diff --git a/src-tauri/src/commands/radio_backups.rs b/src-tauri/src/commands/radio_backups.rs index 9a0190f..0f00c12 100644 --- a/src-tauri/src/commands/radio_backups.rs +++ b/src-tauri/src/commands/radio_backups.rs @@ -93,6 +93,15 @@ fn label_for(key: &str) -> String { "uv6" | "baofeng_uv6" => "Baofeng UV-6", "gt5r" | "baofeng_gt5r" => "Baofeng GT-5R", "uv5g" | "radioddity_uv5g" => "Radioddity UV-5G", + "bfa58" | "baofeng_bfa58" => "Baofeng BF-A58", + "uv82wp" | "baofeng_uv82wp" => "Baofeng UV-82WP", + "gt3wp" | "baofeng_gt3wp" => "Baofeng GT-3WP", + "rt6" | "retevis_rt6" => "Retevis RT6", + "bfa58s" | "baofeng_bfa58s" => "Baofeng BF-A58S", + "uvs9x3" | "baofeng_uvs9x3" => "Baofeng UV-S9X3", + "5rx" | "baofeng_5rx" => "Baofeng 5RX", + "uv9r" | "baofeng_uv9r" => "Baofeng UV-9R", + "uv9g" | "baofeng_uv9g" => "Baofeng UV-9G", other => return other.to_string(), } .to_string() diff --git a/src-tauri/src/db.rs b/src-tauri/src/db.rs index 0e70210..6deba95 100644 --- a/src-tauri/src/db.rs +++ b/src-tauri/src/db.rs @@ -63,7 +63,7 @@ mod tests { // AT-D890UV, AT-D578UV and AT-D868UV, Yaesu FT5D, Icom ID-52, Kenwood TH-D75, Kenwood TH-D72 // the Binteradio BT-9000, Kenwood TM-D710, Icom ID-5100, TYT MD-380 and Yaesu // FTM-300DR, FTM-400 and FTM-510DR, the FT-857D, FT-897D and FT-891, the Icom ID-51 Plus, the Quansheng UV-K5 (stock and egzumer), and - // the UV-5R family's seven Experimental models (#168). (0015 + // the UV-5R family's sixteen Experimental models (#168). (0015 // removed the Vero VR-N76 placeholder.) None of the last five has a // migration of its own — seeding INSERTs new (manufacturer, model) // rows, so a new model reaches existing databases on the next startup @@ -73,10 +73,10 @@ mod tests { .await .unwrap(); assert_eq!( - count.0, 29, + count.0, 38, "expected the UV-5R, TD-H3, AT-D890UV, AT-D578UV, AT-D868UV, FT5D, ID-52, TH-D75, TH-D72, BT-9000, \ TM-D710, ID-5100, MD-380, FTM-300DR, FTM-400, FTM-510DR, FT-857D, FT-897D, FT-891, ID-51 Plus, UV-K5, UV-K5 (egzumer), \ - UV-82, UV-82HP, UV-82X3, BF-F8HP, UV-6, GT-5R and UV-5G seeded models" + UV-82, UV-82HP, UV-82X3, BF-F8HP, UV-6, GT-5R, UV-5G, BF-A58, UV-82WP, GT-3WP, RT6, BF-A58S, UV-S9X3, 5RX, UV-9R and UV-9G seeded models" ); let models: Vec<(String,)> = @@ -88,9 +88,10 @@ mod tests { assert_eq!( names, vec![ - "AT-D578UV", "AT-D868UV", "AT-D890UV", "BF-F8HP", "BT-9000", "FT-857D", "FT-891", "FT-897D", "FT5D", "FTM-300DR", "FTM-400", "FTM-510DR", "GT-5R", - "ID-51 Plus", "ID-5100", "ID-52", "MD-380", "TD-H3", "TH-D72", "TH-D75", "TM-D710", "UV-5G", "UV-5R", "UV-6", "UV-82", "UV-82HP", "UV-82X3", - "UV-K5", "UV-K5 (egzumer)" + "5RX", "AT-D578UV", "AT-D868UV", "AT-D890UV", "BF-A58", "BF-A58S", "BF-F8HP", "BT-9000", "FT-857D", "FT-891", "FT-897D", "FT5D", + "FTM-300DR", "FTM-400", "FTM-510DR", "GT-3WP", "GT-5R", "ID-51 Plus", "ID-5100", "ID-52", "MD-380", "RT6", "TD-H3", "TH-D72", + "TH-D75", "TM-D710", "UV-5G", "UV-5R", "UV-6", "UV-82", "UV-82HP", "UV-82WP", "UV-82X3", "UV-9G", "UV-9R", "UV-K5", "UV-K5 (egzumer)", + "UV-S9X3" ] ); @@ -100,7 +101,7 @@ mod tests { .fetch_one(&pool) .await .unwrap(); - assert_eq!(count2.0, 29, "seeding should be idempotent"); + assert_eq!(count2.0, 38, "seeding should be idempotent"); // A new database starts with NO talkgroups. The BrandMeister list used // to be compiled in and seeded here; it is downloaded on request now, diff --git a/src-tauri/src/gt3wp_settings_schema.json b/src-tauri/src/gt3wp_settings_schema.json new file mode 100644 index 0000000..3210dc0 --- /dev/null +++ b/src-tauri/src/gt3wp_settings_schema.json @@ -0,0 +1,1111 @@ +[ + { + "key": "section-general", + "label": "General", + "type": "section", + "group": "General" + }, + { + "key": "save", + "label": "Battery Saver", + "type": "select", + "options": [ + "Off", + "1:1", + "1:2", + "1:3", + "1:4" + ] + }, + { + "key": "autolk", + "label": "Automatic Key Lock", + "type": "boolean" + }, + { + "key": "keylock", + "label": "Keypad Lock", + "type": "boolean" + }, + { + "key": "almod", + "label": "Alarm Mode", + "type": "select", + "options": [ + "Site", + "Tone", + "Code" + ] + }, + { + "key": "alarm", + "label": "Alarm Sound", + "type": "boolean" + }, + { + "key": "fmradio", + "label": "Broadcast FM Radio", + "type": "boolean" + }, + { + "key": "reset", + "label": "RESET Menu Enabled", + "type": "boolean" + }, + { + "key": "menu", + "label": "All Menus Enabled", + "type": "boolean" + }, + { + "key": "section-display", + "label": "Display", + "type": "section", + "group": "Display" + }, + { + "key": "abr", + "label": "Backlight Timeout", + "type": "select", + "options": [ + "Off", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "mdfa", + "label": "Display Mode (A)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "mdfb", + "label": "Display Mode (B)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "displayab", + "label": "Display Side", + "type": "select", + "options": [ + "A", + "B" + ] + }, + { + "key": "wtled", + "label": "Standby LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "rxled", + "label": "RX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "txled", + "label": "TX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "poweron_msg.line1", + "label": "Power-On Message Line 1", + "type": "text", + "max_length": 7 + }, + { + "key": "poweron_msg.line2", + "label": "Power-On Message Line 2", + "type": "text", + "max_length": 7 + }, + { + "key": "section-sounds", + "label": "Sounds", + "type": "section", + "group": "Sounds" + }, + { + "key": "beep", + "label": "Key Beep", + "type": "boolean" + }, + { + "key": "roger", + "label": "Roger Beep", + "type": "boolean" + }, + { + "key": "voice", + "label": "Voice Prompt", + "type": "select", + "options": [ + "Off", + "English", + "Chinese" + ] + }, + { + "key": "section-transmit-and-receive", + "label": "Transmit & Receive", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "squelch", + "label": "Carrier Squelch Level", + "type": "integer", + "min": 0, + "max": 9 + }, + { + "key": "timeout", + "label": "Timeout Timer", + "type": "select", + "options": [ + "15 sec", + "30 sec", + "45 sec", + "60 sec", + "75 sec", + "90 sec", + "105 sec", + "120 sec", + "135 sec", + "150 sec", + "165 sec", + "180 sec", + "195 sec", + "210 sec", + "225 sec", + "240 sec", + "255 sec", + "270 sec", + "285 sec", + "300 sec", + "315 sec", + "330 sec", + "345 sec", + "360 sec", + "375 sec", + "390 sec", + "405 sec", + "420 sec", + "435 sec", + "450 sec", + "465 sec", + "480 sec", + "495 sec", + "510 sec", + "525 sec", + "540 sec", + "555 sec", + "570 sec", + "585 sec", + "600 sec" + ] + }, + { + "key": "vox", + "label": "VOX Sensitivity", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "tdr", + "label": "Dual Watch", + "type": "boolean" + }, + { + "key": "tdrab", + "label": "Dual Watch TX Priority", + "type": "select", + "options": [ + "Off", + "A", + "B" + ] + }, + { + "key": "ste", + "label": "Squelch Tail Eliminate (HT to HT)", + "type": "boolean" + }, + { + "key": "rpste", + "label": "Squelch Tail Eliminate (repeater)", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "rptrl", + "label": "STE Repeater Delay", + "type": "select", + "options": [ + "OFF", + "100 ms", + "200 ms", + "300 ms", + "400 ms", + "500 ms", + "600 ms", + "700 ms", + "800 ms", + "900 ms", + "1000 ms" + ] + }, + { + "key": "section-band-limits", + "label": "Band Limits", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "limits.vhf.lower", + "label": "VHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf.upper", + "label": "VHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.lower", + "label": "UHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.upper", + "label": "UHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "section-memory-and-vfo", + "label": "Memory & VFO", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "workmode", + "label": "VFO/MR Mode", + "type": "select", + "options": [ + "Frequency", + "Channel" + ] + }, + { + "key": "wmchannel.mrcha", + "label": "MR A Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "wmchannel.mrchb", + "label": "MR B Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "section-vfo", + "label": "VFO A / B", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "vfoa.freq", + "label": "VFO A Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.freq", + "label": "VFO B Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.sftd", + "label": "VFO A Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfob.sftd", + "label": "VFO B Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfoa.offset", + "label": "VFO A Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.offset", + "label": "VFO B Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.txpower", + "label": "VFO A Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfob.txpower", + "label": "VFO B Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfoa.widenarr", + "label": "VFO A Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfob.widenarr", + "label": "VFO B Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfoa.scode", + "label": "VFO A PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfob.scode", + "label": "VFO B PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfoa.step", + "label": "VFO A Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "vfob.step", + "label": "VFO B Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "section-scan", + "label": "Scan", + "type": "section", + "group": "Scan" + }, + { + "key": "screv", + "label": "Scan Resume", + "type": "select", + "options": [ + "TO", + "CO", + "SE" + ] + }, + { + "key": "section-dtmf", + "label": "DTMF & ANI", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "dtmfst", + "label": "DTMF Sidetone", + "type": "select", + "options": [ + "OFF", + "DT-ST", + "ANI-ST", + "DT+ANI" + ] + }, + { + "key": "pttid", + "label": "When to send PTT ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "ani.dtmfon", + "label": "DTMF Speed (on)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "ani.dtmfoff", + "label": "DTMF Speed (off)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "pttlt", + "label": "PTT ID Delay", + "type": "integer", + "min": 0, + "max": 50 + }, + { + "key": "ani.code", + "label": "ANI Code", + "type": "text", + "max_length": 5 + }, + { + "key": "ani.aniid", + "label": "ANI ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "section-ptt-id-codes", + "label": "PTT ID Codes", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "pttid/0.code", + "label": "PTT ID Code 1", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/1.code", + "label": "PTT ID Code 2", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/2.code", + "label": "PTT ID Code 3", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/3.code", + "label": "PTT ID Code 4", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/4.code", + "label": "PTT ID Code 5", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/5.code", + "label": "PTT ID Code 6", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/6.code", + "label": "PTT ID Code 7", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/7.code", + "label": "PTT ID Code 8", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/8.code", + "label": "PTT ID Code 9", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/9.code", + "label": "PTT ID Code 10", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/10.code", + "label": "PTT ID Code 11", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/11.code", + "label": "PTT ID Code 12", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/12.code", + "label": "PTT ID Code 13", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/13.code", + "label": "PTT ID Code 14", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/14.code", + "label": "PTT ID Code 15", + "type": "text", + "max_length": 5 + } +] diff --git a/src-tauri/src/radios/baofeng_5rx/mod.rs b/src-tauri/src/radios/baofeng_5rx/mod.rs new file mode 100644 index 0000000..7f48dc9 --- /dev/null +++ b/src-tauri/src/radios/baofeng_5rx/mod.rs @@ -0,0 +1,32 @@ +//! Baofeng 5RX (`driver_key = "baofeng_5rx"`) — Experimental (#168). +//! +//! CHIRP `BF5RXRadio` (`chirp/drivers/baofeng_wp970i.py`): the UV-S9X3 magic, the UV-S9X3's map, and a wider receiver (108-136 and 350-390 MHz as well). High / Low stored as 0 / 2. +//! +//! The radio-address map is the UV-5R's, so everything else is the +//! hardware-proven UV-5R session in `radios/baofeng_uv5r` (identify, download, +//! back up, patch, upload, read back). The model's map and its differences are +//! ported from CHIRP's `baofeng_wp970i.py` and `baofeng_common.py` +//! (GPLv2-or-later, by Jim Unroe and the CHIRP contributors). Nobody here owns +//! one: nothing about this model has been confirmed on a radio, so it ships +//! Experimental and the app warns before every write. See +//! `docs/radios/baofeng-uv5r-family.md`. + +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_UVS9X3}; + +pub(crate) static BAOFENG_5RX: Variant = Variant { + key: "baofeng_5rx", + display_name: "Baofeng 5RX", + short: "5RX", + idents: &[MAGIC_UVS9X3], + aux_block: true, + power: Power::HighLowAt2, + name_len: 7, + chirp: Chirp::Wp970i, + orig_by_firmware: false, + chirp_models: &["5RX"], + file_prefix: "5rx", + hardware_verified: false, +}; + +/// Registry entry (see `radios/registry.rs`). +pub(crate) static DRIVER: BaofengUv5r = BaofengUv5r(&BAOFENG_5RX); diff --git a/src-tauri/src/radios/baofeng_bfa58/mod.rs b/src-tauri/src/radios/baofeng_bfa58/mod.rs new file mode 100644 index 0000000..5432d2b --- /dev/null +++ b/src-tauri/src/radios/baofeng_bfa58/mod.rs @@ -0,0 +1,32 @@ +//! Baofeng BF-A58 (`driver_key = "baofeng_bfa58"`) — Experimental (#168). +//! +//! CHIRP `BFA58` (`chirp/drivers/baofeng_wp970i.py`): the WP970I magic, High / Med / Low, seven-character names. CHIRP's aliases: Rugged RH5X, Baofeng UV-9R Pro. Power follows Baofeng's own programmer, not CHIRP: High / Low, stored 0 / 1, with VFO power in bit 7 (Tim, 2026-12-02; see the family doc). +//! +//! The radio-address map is the UV-5R's, so everything else is the +//! hardware-proven UV-5R session in `radios/baofeng_uv5r` (identify, download, +//! back up, patch, upload, read back). The model's map and its differences are +//! ported from CHIRP's `baofeng_wp970i.py` and `baofeng_common.py` +//! (GPLv2-or-later, by Jim Unroe and the CHIRP contributors). Nobody here owns +//! one: nothing about this model has been confirmed on a radio, so it ships +//! Experimental and the app warns before every write. See +//! `docs/radios/baofeng-uv5r-family.md`. + +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_WP970I}; + +pub(crate) static BAOFENG_BFA58: Variant = Variant { + key: "baofeng_bfa58", + display_name: "Baofeng BF-A58", + short: "BF-A58", + idents: &[MAGIC_WP970I], + aux_block: true, + power: Power::HighLow, + name_len: 7, + chirp: Chirp::Wp970i, + orig_by_firmware: false, + chirp_models: &["BF-A58", "RH5X", "UV-9R Pro"], + file_prefix: "bfa58", + hardware_verified: false, +}; + +/// Registry entry (see `radios/registry.rs`). +pub(crate) static DRIVER: BaofengUv5r = BaofengUv5r(&BAOFENG_BFA58); diff --git a/src-tauri/src/radios/baofeng_bfa58s/mod.rs b/src-tauri/src/radios/baofeng_bfa58s/mod.rs new file mode 100644 index 0000000..ea5c500 --- /dev/null +++ b/src-tauri/src/radios/baofeng_bfa58s/mod.rs @@ -0,0 +1,32 @@ +//! Baofeng BF-A58S (`driver_key = "baofeng_bfa58s"`) — Experimental (#168). +//! +//! CHIRP `BFA58S` (`chirp/drivers/baofeng_wp970i.py`): the WP970I magic, tri-band (the 220 band and its limits), High / Low stored as 0 / 2. CHIRP's alias: Baofeng UV-82III. +//! +//! The radio-address map is the UV-5R's, so everything else is the +//! hardware-proven UV-5R session in `radios/baofeng_uv5r` (identify, download, +//! back up, patch, upload, read back). The model's map and its differences are +//! ported from CHIRP's `baofeng_wp970i.py` and `baofeng_common.py` +//! (GPLv2-or-later, by Jim Unroe and the CHIRP contributors). Nobody here owns +//! one: nothing about this model has been confirmed on a radio, so it ships +//! Experimental and the app warns before every write. See +//! `docs/radios/baofeng-uv5r-family.md`. + +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_WP970I}; + +pub(crate) static BAOFENG_BFA58S: Variant = Variant { + key: "baofeng_bfa58s", + display_name: "Baofeng BF-A58S", + short: "BF-A58S", + idents: &[MAGIC_WP970I], + aux_block: true, + power: Power::HighLowAt2, + name_len: 7, + chirp: Chirp::Wp970i, + orig_by_firmware: false, + chirp_models: &["BF-A58S", "UV-82III"], + file_prefix: "bfa58s", + hardware_verified: false, +}; + +/// Registry entry (see `radios/registry.rs`). +pub(crate) static DRIVER: BaofengUv5r = BaofengUv5r(&BAOFENG_BFA58S); diff --git a/src-tauri/src/radios/baofeng_bff8hp/mod.rs b/src-tauri/src/radios/baofeng_bff8hp/mod.rs index 0a56eb9..b02e8da 100644 --- a/src-tauri/src/radios/baofeng_bff8hp/mod.rs +++ b/src-tauri/src/radios/baofeng_bff8hp/mod.rs @@ -12,7 +12,7 @@ //! model has been confirmed on a radio, so it ships Experimental and the app //! warns before every write. See `docs/radios/baofeng-uv5r-family.md`. -use crate::radios::baofeng_uv5r::{BaofengUv5r, Variant, MAGIC_291, MAGIC_A58}; +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_291, MAGIC_A58}; pub(crate) static BAOFENG_BFF8HP: Variant = Variant { key: "baofeng_bff8hp", @@ -20,8 +20,11 @@ pub(crate) static BAOFENG_BFF8HP: Variant = Variant { short: "BF-F8HP", idents: &[MAGIC_291, MAGIC_A58], aux_block: true, - tri_power: true, + power: Power::HighMedLow, + name_len: 7, + chirp: Chirp::Uv5r, orig_by_firmware: false, + chirp_models: &["BF-F8HP", "RT5(tri-power)", "GA-5S", "UV-5XP", "TI-F8+", "UV-5R Pro", "TS-T9+", "TD-UV5R TriPower"], file_prefix: "bff8hp", hardware_verified: false, }; diff --git a/src-tauri/src/radios/baofeng_gt3wp/mod.rs b/src-tauri/src/radios/baofeng_gt3wp/mod.rs new file mode 100644 index 0000000..d28d1d5 --- /dev/null +++ b/src-tauri/src/radios/baofeng_gt3wp/mod.rs @@ -0,0 +1,32 @@ +//! Baofeng GT-3WP (`driver_key = "baofeng_gt3wp"`) — Experimental (#168). +//! +//! CHIRP `GT3WP` (`chirp/drivers/baofeng_wp970i.py`): the WP970I magic, High / Med / Low, seven-character names. Power follows Baofeng's own programmer, not CHIRP: High / Low, stored 0 / 1, with VFO power in bit 7 (Tim, 2026-12-02; see the family doc). +//! +//! The radio-address map is the UV-5R's, so everything else is the +//! hardware-proven UV-5R session in `radios/baofeng_uv5r` (identify, download, +//! back up, patch, upload, read back). The model's map and its differences are +//! ported from CHIRP's `baofeng_wp970i.py` and `baofeng_common.py` +//! (GPLv2-or-later, by Jim Unroe and the CHIRP contributors). Nobody here owns +//! one: nothing about this model has been confirmed on a radio, so it ships +//! Experimental and the app warns before every write. See +//! `docs/radios/baofeng-uv5r-family.md`. + +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_WP970I}; + +pub(crate) static BAOFENG_GT3WP: Variant = Variant { + key: "baofeng_gt3wp", + display_name: "Baofeng GT-3WP", + short: "GT-3WP", + idents: &[MAGIC_WP970I], + aux_block: true, + power: Power::HighLow, + name_len: 7, + chirp: Chirp::Wp970i, + orig_by_firmware: false, + chirp_models: &["GT-3WP"], + file_prefix: "gt3wp", + hardware_verified: false, +}; + +/// Registry entry (see `radios/registry.rs`). +pub(crate) static DRIVER: BaofengUv5r = BaofengUv5r(&BAOFENG_GT3WP); diff --git a/src-tauri/src/radios/baofeng_gt5r/mod.rs b/src-tauri/src/radios/baofeng_gt5r/mod.rs index 0f36f0d..daeacc7 100644 --- a/src-tauri/src/radios/baofeng_gt5r/mod.rs +++ b/src-tauri/src/radios/baofeng_gt5r/mod.rs @@ -11,7 +11,7 @@ //! model has been confirmed on a radio, so it ships Experimental and the app //! warns before every write. See `docs/radios/baofeng-uv5r-family.md`. -use crate::radios::baofeng_uv5r::{BaofengUv5r, Variant, MAGIC_291, MAGIC_ORIG}; +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_291, MAGIC_ORIG}; pub(crate) static BAOFENG_GT5R: Variant = Variant { key: "baofeng_gt5r", @@ -19,8 +19,11 @@ pub(crate) static BAOFENG_GT5R: Variant = Variant { short: "GT-5R", idents: &[MAGIC_291, MAGIC_ORIG], aux_block: true, - tri_power: false, + power: Power::HighLow, + name_len: 7, + chirp: Chirp::Uv5r, orig_by_firmware: true, + chirp_models: &["GT-5R"], file_prefix: "gt5r", hardware_verified: false, }; diff --git a/src-tauri/src/radios/baofeng_uv5r/fake_tests.rs b/src-tauri/src/radios/baofeng_uv5r/fake_tests.rs index c02a2bf..6d5b239 100644 --- a/src-tauri/src/radios/baofeng_uv5r/fake_tests.rs +++ b/src-tauri/src/radios/baofeng_uv5r/fake_tests.rs @@ -152,8 +152,11 @@ fn variant(idents: &'static [(&'static str, &'static [u8])], aux_block: bool) -> short: "TEST", idents, aux_block, - tri_power: false, + power: Power::HighLow, + name_len: 7, + chirp: Chirp::Uv5r, orig_by_firmware: false, + chirp_models: &[], file_prefix: "test", hardware_verified: false, })) @@ -249,3 +252,131 @@ fn a_restore_skips_the_calibration_gaps() { assert!(w.iter().all(|&(a, _)| !(0x0CF0..0x0D00).contains(&a) && !(0x0DF0..0x0E00).contains(&a))); assert!(w.iter().any(|&(a, _)| a == 0x1EE0) && w.iter().any(|&(a, _)| a == 0x1FC0)); } + +// ---- the WP970I class (#168, second entry) ---- + +/// The UV-9G answers only its own magic: a radio that answers the WP970I one +/// (a BF-A58, UV-9R, …) is refused before a block is read. +#[test] +fn the_uv9g_refuses_a_wp970i_radio() { + let v = &crate::radios::baofeng_uv9g::BAOFENG_UV9G; + let mut port = FakePort::new(FakeUv5r::new(MAGIC_WP970I.1, true)); + let e = ident_radio_as(&mut port, v).unwrap_err(); + assert!(e.contains("did not answer as a UV-9G"), "{e}"); + assert!(port.radio.reads.is_empty() && port.radio.writes.is_empty()); +} + +/// A tri-band settings write: the 220 band limits land in the band-limit +/// block (aux, radio 0x1FCA), the VFO's High / Low goes in as 0 / 2, and the +/// read-back covers exactly the blocks that went out. +#[test] +fn a_bfa58s_settings_write_reaches_the_220_limits_and_verifies() { + let v = &crate::radios::baofeng_bfa58s::BAOFENG_BFA58S; + let mut port = FakePort::new(FakeUv5r::new(MAGIC_WP970I.1, true)); + let (m, ident) = ident_radio_as(&mut port, v).unwrap(); + assert_eq!(m, "WP970I"); + let base = download(&mut port, &ident, v.aux_block).unwrap(); + let mut image = base.clone(); + let n = settings::apply_profile_settings_for( + v, + &mut image, + crate::seed::BFA58S_SETTINGS_SCHEMA, + r#"{"limits.vhf2.lower":222,"limits.vhf2.upper":225,"vfoa.txpower_hilo":"Low","pttid":"EOT"}"#, + ) + .unwrap(); + assert_eq!(n, 4); + let main = settings::changed_runs(&base, &image, settings::SETTINGS_MAIN_RANGES, main_offset); + let aux = settings::changed_runs(&base, &image, settings::aux_ranges(v, &base), aux_offset); + assert_eq!(aux, vec![(0x1FC0, 0x1FD0)]); + let (ok, note, _) = upload_and_verify(&mut port, v, &image, &main, &aux).unwrap().unwrap(); + assert!(ok, "{note:?}"); + assert_eq!(port.radio.mem[0x1FCB..0x1FCF], [0x02, 0x22, 0x02, 0x25]); + assert_eq!(port.radio.mem[0x0F1F] & 0x03, 2, "VFO A Low is 2"); + assert_eq!(port.radio.mem[0x0E33], 2, "PTT ID on EOT"); +} + +/// On HN5RV01 firmware the WP970I class keeps to digits: a code with `*` in +/// it is left exactly as read, a digits-only code is written. +#[test] +fn hn5rv01_wp970i_writes_digit_codes_only() { + let v = &crate::radios::baofeng_uvs9x3::BAOFENG_UVS9X3; + let mut img = vec![0xFFu8; FULL_IMAGE_LEN]; + img[7] = 0xDD; + img[0x1838..0x183F].copy_from_slice(b"HN5RV01"); + let before = img.clone(); + let schema = crate::seed::UVS9X3_SETTINGS_SCHEMA; + let n = settings::apply_profile_settings_for(v, &mut img, schema, r#"{"pttid/0.code":"1*2"}"#).unwrap(); + assert_eq!(n, 0); + assert_eq!(img, before); + let n = settings::apply_profile_settings_for(v, &mut img, schema, r#"{"pttid/0.code":"135"}"#).unwrap(); + assert_eq!(n, 1); + assert_eq!(img[0x0B08..0x0B0D], [1, 3, 5, 0xFF, 0xFF]); + // A stored code with a non-digit in it is not shown, so it cannot come + // back from the form with that character dropped. + img[0x0B18..0x0B1D].copy_from_slice(&[1, 0x0B, 2, 0xFF, 0xFF]); + let read = settings::decode_settings_from_image_for(v, &img, schema).unwrap(); + assert_eq!(read["pttid/0.code"], "135"); + assert!(read.get("pttid/1.code").is_none()); +} + +/// What restore makes of a file for `v`: rearranged, then judged. +fn restore_gate(v: &Variant, file: &[u8]) -> Result, String> { + let image = restore_image_for(v, file)?.into_owned(); + check_restore_image_for(v, &image)?; + Ok(image) +} + +/// A file CHIRP saved from a WP970I-class radio restores as the image this +/// app would have taken: `baofeng_wp970i` puts the ident after radio +/// 0x0000-0x2000, and every CHIRP `.img` carries a metadata trailer naming the +/// model. Built here from a mock download, the way CHIRP lays out the radio. +#[test] +fn a_chirp_saved_wp970i_file_restores_as_our_image() { + let v = &crate::radios::baofeng_bfa58::BAOFENG_BFA58; + let mut port = FakePort::new(FakeUv5r::new(MAGIC_WP970I.1, true)); + let (_m, ident) = ident_radio_as(&mut port, v).unwrap(); + let ours = download(&mut port, &ident, v.aux_block).unwrap(); + assert_eq!(ours.len(), FULL_IMAGE_LEN); + + let mut bare = vec![0xFFu8; 0x2000]; + bare[..0x1800].copy_from_slice(&ours[8..0x1808]); + bare[0x1EC0..].copy_from_slice(&ours[0x1808..]); + bare.extend_from_slice(&ours[..8]); + let with = |trailer: &[u8]| [bare.as_slice(), trailer].concat(); + + // CHIRP's own model name, and one of CHIRP's aliases for the class. + assert_eq!(restore_gate(v, &with(b"\x00\xffchirp\xeeimg\x00\x01eyJ2ZW5kb3IiOiAiQmFvZmVuZyIsICJtb2RlbCI6ICJCRi1BNTgiLCAicmNsYXNzIjogIlgifQ==")).unwrap(), ours); + assert_eq!(restore_gate(v, &with(b"\x00\xffchirp\xeeimg\x00\x01eyJ2ZW5kb3IiOiAiQmFvZmVuZyIsICJtb2RlbCI6ICJSSDVYIiwgInJjbGFzcyI6ICJYIn0=")).unwrap(), ours); + // The restore report counts what goes to the radio, not the file. + let chirp_file = with(b"\x00\xffchirp\xeeimg\x00\x01eyJ2ZW5kb3IiOiAiQmFvZmVuZyIsICJtb2RlbCI6ICJCRi1BNTgiLCAicmNsYXNzIjogIlgifQ=="); + let restorer = super::BaofengUv5r(v); + assert_eq!(ImageRestorer::restore_len(&restorer, &chirp_file), FULL_IMAGE_LEN); + assert_eq!(ImageRestorer::restore_len(&restorer, &ours), FULL_IMAGE_LEN); + // Another radio's file in the same layout: a BF-A58S's, a GMRS-V2's. + let e = restore_gate(v, &with(b"\x00\xffchirp\xeeimg\x00\x01eyJ2ZW5kb3IiOiAiQmFvZmVuZyIsICJtb2RlbCI6ICJCRi1BNThTIiwgInJjbGFzcyI6ICJYIn0=")).unwrap_err(); + assert!(e.contains("CHIRP saved this file as a BF-A58S"), "{e}"); + assert!(restore_gate(v, &with(b"\x00\xffchirp\xeeimg\x00\x01eyJ2ZW5kb3IiOiAiQmFvZmVuZyIsICJtb2RlbCI6ICJHTVJTLVYyIiwgInJjbGFzcyI6ICJYIn0=")).is_err()); + // No metadata: CHIRP's wp970i driver always writes it, so which radio is unknown. + let e = restore_gate(v, &bare).unwrap_err(); + assert!(e.contains("none of the metadata"), "{e}"); + // A UV-5R-class model never takes that layout: uv5r.py does not write it. + assert!(restore_gate(&super::UV5R, &with(b"\x00\xffchirp\xeeimg\x00\x01eyJ2ZW5kb3IiOiAiQmFvZmVuZyIsICJtb2RlbCI6ICJVVi01UiIsICJyY2xhc3MiOiAiWCJ9")).is_err()); + // A TD-H3 backup is 0x2008 bytes too, ending 0xFF: refused on shape. + assert!(restore_gate(v, &vec![0xFFu8; 0x2008]).is_err()); +} + +/// CHIRP's trailer is dropped for every family member, so a file CHIRP's +/// `uv5r.py` saved (our layout, plus the trailer) restores when it names this +/// model; a trailer anywhere else is not one, and the file is refused on its +/// length. A file with no trailer is judged on shape, as before. +#[test] +fn chirps_metadata_trailer_is_dropped_only_at_an_image_length() { + let v = &super::UV5R; + let mut port = FakePort::new(FakeUv5r::new(MAGIC_291.1, true)); + let (_m, ident) = ident_radio_as(&mut port, v).unwrap(); + let ours = download(&mut port, &ident, v.aux_block).unwrap(); + assert_eq!(restore_gate(v, &[ours.as_slice(), b"\x00\xffchirp\xeeimg\x00\x01eyJ2ZW5kb3IiOiAiQmFvZmVuZyIsICJtb2RlbCI6ICJVVi01UiIsICJyY2xhc3MiOiAiWCJ9"].concat()).unwrap(), ours); + assert!(restore_gate(v, &[ours.as_slice(), b"\x00\xffchirp\xeeimg\x00\x01eyJ2ZW5kb3IiOiAiQmFvZmVuZyIsICJtb2RlbCI6ICJGLTExIiwgInJjbGFzcyI6ICJYIn0="].concat()).is_err()); + assert_eq!(restore_gate(v, &ours).unwrap(), ours); + assert!(restore_gate(v, &[&ours[..0x1900], b"\x00\xffchirp\xeeimg\x00\x01eyJ2ZW5kb3IiOiAiQmFvZmVuZyIsICJtb2RlbCI6ICJVVi01UiIsICJyY2xhc3MiOiAiWCJ9"].concat()).is_err()); +} diff --git a/src-tauri/src/radios/baofeng_uv5r/mod.rs b/src-tauri/src/radios/baofeng_uv5r/mod.rs index a6584bb..39a8ea7 100644 --- a/src-tauri/src/radios/baofeng_uv5r/mod.rs +++ b/src-tauri/src/radios/baofeng_uv5r/mod.rs @@ -73,13 +73,22 @@ pub(crate) struct Variant { /// The aux block at radio 0x1EC0 (firmware string, power-on message, band /// limits). CHIRP's `_aux_block`; only the UV-6 lacks it. pub aux_block: bool, - /// High / Med / Low (`lowpower` 0/1/2) rather than High / Low (0/1). - pub tri_power: bool, + /// How the channel's `lowpower` bits encode the power levels. + pub power: Power, + /// Name characters the radio shows: 7, or 6 on the WP970I-class UV-82WP + /// and RT6 (CHIRP `LENGTH_NAME`). The cell is 7 bytes either way. + pub name_len: usize, + /// Which CHIRP driver the model's map is ported from. + pub chirp: Chirp, /// Whether the firmware string decides CHIRP's `_is_orig()` (pre-BFB291: /// old band-limit block, 6-entry VFO step list). True where CHIRP's class /// leaves it to the firmware (UV-5R, GT-5R, UV-5G); false where the class /// pins it to "not orig" (the UV-82 family, BF-F8HP, UV-6). pub orig_by_firmware: bool, + /// The model names CHIRP writes in an `.img`'s metadata for this radio: + /// its class's `MODEL` and its `ALIASES`. A file CHIRP saved restores only + /// onto a model its metadata names (see [`restore_image_for`]). + pub chirp_models: &'static [&'static str], /// Backup file-name prefix (`uv5r-prewrite-….img`). Also how a restore /// refuses a sibling's backup, whose image looks exactly like this one's. pub file_prefix: &'static str, @@ -87,6 +96,43 @@ pub(crate) struct Variant { pub hardware_verified: bool, } +/// The channel power encodings CHIRP uses across the family (`lowpower:2`). +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub(crate) enum Power { + /// High 0, Low 1 (the UV-5R). Also the WP970I class's two-level models + /// (BF-A58, UV-82WP, GT-3WP, RT6, UV-9R, UV-9G): CHIRP gives them High / + /// Med / Low, but Baofeng's WP970I and GT-3WP programmers offer High / Low + /// and store Low as 1, and we follow the programmer (Tim, 2026-12-02). + HighLow, + /// High 0, Med 1, Low 2 (CHIRP `UV5R_POWER_LEVELS3`: UV-82HP, BF-F8HP). + HighMedLow, + /// High 0, Low 2: two levels, skipping 1 (`baofeng_common`'s `_tri_band` + /// models, the BF-A58S, UV-S9X3 and 5RX; `TXPOWER_HIGH` / `TXPOWER_LOW`). + HighLowAt2, +} + +impl Power { + /// The model has a Med level. + pub(crate) fn has_med(self) -> bool { + self == Power::HighMedLow + } +} + +/// The CHIRP driver a model's map comes from. The radio-address map is the +/// same in both (`baofeng_wp970i.py`'s `#seekto`s are radio addresses, `uv5r.py`'s +/// are the same addresses plus its 8-byte ident prefix); what differs is what +/// each driver does with it. +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub(crate) enum Chirp { + /// `uv5r.py`: the UV-5R and its seven siblings. + Uv5r, + /// `baofeng_wp970i.py` on `baofeng_common.py`: the BF-A58 / UV-9R class. + /// It has one DTMF map whatever the firmware. (Its VFO frequency write + /// also leaves the band bit as read; we set it, as the radio-authored + /// images and the vendor CPS do -- see the family doc.) + Wp970i, +} + /// The Baofeng UV-5R — the hardware-verified member of the family. pub(crate) static UV5R: Variant = Variant { key: "baofeng_uv5r", @@ -94,8 +140,11 @@ pub(crate) static UV5R: Variant = Variant { short: "UV-5R", idents: IDENTS, aux_block: true, - tri_power: false, + power: Power::HighLow, + name_len: 7, + chirp: Chirp::Uv5r, orig_by_firmware: true, + chirp_models: &["UV-5R", "UV-5X", "RT5R", "RT5RV", "RT5", "RH5R", "UV-5R EX", "A-5R"], file_prefix: "uv5r", hardware_verified: true, }; @@ -109,6 +158,13 @@ pub(crate) const MAGIC_UV6_ORIG: (&str, &[u8]) = ("UV6_ORIG", &[0x50, 0xBB, 0xFF pub(crate) const MAGIC_A58: (&str, &[u8]) = ("A58", &[0x50, 0xBB, 0xFF, 0x20, 0x14, 0x04, 0x13]); pub(crate) const MAGIC_UV5G: (&str, &[u8]) = ("UV5G", &[0x50, 0xBB, 0xFF, 0x20, 0x12, 0x06, 0x25]); +/// `baofeng_wp970i.py`'s magics. The WP970I one is byte for byte the A58 magic +/// above, and the UV-S9X3 one is the UV-5R's 291 magic: CHIRP names them per +/// driver, and so do we, so the label reported back says which model asked. +pub(crate) const MAGIC_WP970I: (&str, &[u8]) = ("WP970I", &[0x50, 0xBB, 0xFF, 0x20, 0x14, 0x04, 0x13]); +pub(crate) const MAGIC_UV9G: (&str, &[u8]) = ("UV9G", &[0x50, 0xBB, 0xFF, 0x20, 0x12, 0x05, 0x25]); +pub(crate) const MAGIC_UVS9X3: (&str, &[u8]) = ("UVS9X3", &[0x50, 0xBB, 0xFF, 0x20, 0x12, 0x07, 0x25]); + /// Every name a family member's backup can start with, and the model it /// belongs to, so a restore can tell a sibling's backup from an unrelated file /// name (a CHIRP `.img`, say), which it allows. Two per model: the driver's own @@ -132,6 +188,24 @@ const FAMILY_PREFIXES: &[(&str, &str)] = &[ ("baofeng_gt5r", "GT-5R"), ("uv5g", "UV-5G"), ("radioddity_uv5g", "UV-5G"), + ("bfa58", "BF-A58"), + ("baofeng_bfa58", "BF-A58"), + ("uv82wp", "UV-82WP"), + ("baofeng_uv82wp", "UV-82WP"), + ("gt3wp", "GT-3WP"), + ("baofeng_gt3wp", "GT-3WP"), + ("rt6", "RT6"), + ("retevis_rt6", "RT6"), + ("bfa58s", "BF-A58S"), + ("baofeng_bfa58s", "BF-A58S"), + ("uvs9x3", "UV-S9X3"), + ("baofeng_uvs9x3", "UV-S9X3"), + ("5rx", "5RX"), + ("baofeng_5rx", "5RX"), + ("uv9r", "UV-9R"), + ("baofeng_uv9r", "UV-9R"), + ("uv9g", "UV-9G"), + ("baofeng_uv9g", "UV-9G"), ]; // Buffer-offset memory map (image includes the 8-byte ident prefix). @@ -171,6 +245,92 @@ pub(crate) fn check_restore_image(image: &[u8]) -> Result<(), String> { check_restore_image_for(&UV5R, image) } +/// The start of the metadata CHIRP appends to every `.img` it saves, after the +/// radio's bytes (`chirp_common.FileBackedRadio`'s `MAGIC`, then base64 JSON). +const CHIRP_METADATA_MAGIC: &[u8] = b"\x00\xffchirp\xeeimg\x00\x01"; + +/// CHIRP's `baofeng_wp970i` image: radio 0x0000-0x2000, then the 8-byte ident. +const WP970I_CHIRP_LEN: usize = 0x2008; + +/// A file picked for restore, as this driver's image. Two shapes CHIRP saves +/// are rearranged; anything else comes back as given, for +/// [`check_restore_image_for`] to judge: +/// +/// - CHIRP's metadata trailer is dropped, when it starts exactly where one of +/// the image lengths a family member uses ends (so a stray match inside +/// radio data never truncates a file). The trailer names the model CHIRP +/// saved the file as, and a file is refused unless that is one of this +/// model's [`Variant::chirp_models`]: the shape alone would let any +/// `baofeng_common` radio's file (a GMRS-V1, a UV-6R) through; +/// - on the WP970I class, CHIRP's ident-last layout becomes ours: ident, main +/// block, aux from 0x1EC0. The 0x1800-0x1EC0 gap, which neither driver maps, +/// is dropped. Every file CHIRP's `baofeng_wp970i` writes carries the +/// trailer, so one in this layout without it is refused: nothing says which +/// radio it is. A TD-H3 backup is the same 0x2008 bytes, but its last byte +/// is not the ident's 0xDD, so it is left alone and then refused on shape. +pub(crate) fn restore_image_for<'a>(v: &Variant, file: &'a [u8]) -> Result, String> { + let lens = [MIN_IMAGE_LEN, FULL_IMAGE_LEN, WP970I_CHIRP_LEN]; + let cut = lens.iter().copied().find(|&n| file.len() > n && file[n..].starts_with(CHIRP_METADATA_MAGIC)); + let body = match cut { + Some(n) => { + let model = chirp_metadata_model(&file[n + CHIRP_METADATA_MAGIC.len()..]).ok_or_else(|| { + "this file has CHIRP's metadata, but it does not say which radio it came from, \ + so it is not written to one." + .to_string() + })?; + if !v.chirp_models.iter().any(|m| m.eq_ignore_ascii_case(&model)) { + return Err(format!( + "CHIRP saved this file as a {model}, not a {}. Pick a backup taken from a {}.", + v.short, v.short + )); + } + &file[..n] + } + None => file, + }; + let ident_last = body.len() == WP970I_CHIRP_LEN && body[WP970I_CHIRP_LEN - 1] == IDENT_TERMINATOR; + if v.chirp == Chirp::Wp970i && ident_last { + if cut.is_none() { + return Err(format!( + "this file is laid out as CHIRP saves a {}, but it has none of the metadata \ + CHIRP writes with one, so which radio it came from is not known.", + v.short + )); + } + let mut out = body[0x2000..WP970I_CHIRP_LEN].to_vec(); + out.extend_from_slice(&body[..0x1800]); + out.extend_from_slice(&body[0x1EC0..0x2000]); + return Ok(std::borrow::Cow::Owned(out)); + } + Ok(std::borrow::Cow::Borrowed(body)) +} + +/// The `model` named in a CHIRP metadata trailer: base64 of a JSON object. +fn chirp_metadata_model(b64: &[u8]) -> Option { + let mut bits = 0u32; + let mut n = 0; + let mut raw = Vec::with_capacity(b64.len() * 3 / 4); + for &c in b64 { + let d = match c { + b'A'..=b'Z' => c - b'A', + b'a'..=b'z' => c - b'a' + 26, + b'0'..=b'9' => c - b'0' + 52, + b'+' => 62, + b'/' => 63, + b'=' | b'\n' | b'\r' => continue, + _ => return None, + }; + bits = (bits << 6) | u32::from(d); + n += 6; + if n >= 8 { + n -= 8; + raw.push((bits >> n) as u8); + } + } + let meta: serde_json::Value = serde_json::from_slice(&raw).ok()?; + meta.get("model")?.as_str().map(str::to_string) +} + /// [`check_restore_image`] for any family member. A model without the aux /// block (the UV-6) only ever produces the short form, so a long image is some /// other radio's. @@ -251,6 +411,47 @@ const UV5R_DTCS: [u16; 105] = [ /// itself is stateless, so one static instance per model serves the registry. pub(crate) struct BaofengUv5r(pub &'static Variant); +/// Every model on this driver, the UV-5R first. Tests walk it so that a model +/// added here is covered without each test being edited. +#[cfg(test)] +pub(crate) fn family() -> Vec<&'static Variant> { + use crate::radios as r; + vec![ + &UV5R, + &r::baofeng_uv82::BAOFENG_UV82, + &r::baofeng_uv82hp::BAOFENG_UV82HP, + &r::radioddity_uv82x3::RADIODDITY_UV82X3, + &r::baofeng_bff8hp::BAOFENG_BFF8HP, + &r::baofeng_uv6::BAOFENG_UV6, + &r::baofeng_gt5r::BAOFENG_GT5R, + &r::radioddity_uv5g::RADIODDITY_UV5G, + &r::baofeng_bfa58::BAOFENG_BFA58, + &r::baofeng_uv82wp::BAOFENG_UV82WP, + &r::baofeng_gt3wp::BAOFENG_GT3WP, + &r::retevis_rt6::RETEVIS_RT6, + &r::baofeng_bfa58s::BAOFENG_BFA58S, + &r::baofeng_uvs9x3::BAOFENG_UVS9X3, + &r::baofeng_5rx::BAOFENG_5RX, + &r::baofeng_uv9r::BAOFENG_UV9R, + &r::baofeng_uv9g::BAOFENG_UV9G, + ] +} + +/// Every family member is registered under its own key and display name, and +/// a sibling's backup can be told from it by file name. +#[cfg(test)] +#[test] +fn family_members_are_registered_with_backup_prefixes() { + for v in family() { + let d = crate::radios::registry::driver_for_key(v.key) + .unwrap_or_else(|| panic!("{} is not registered", v.key)); + assert_eq!(d.display_name(), v.display_name); + assert_eq!(d.hardware_verified(), v.hardware_verified); + assert!(FAMILY_PREFIXES.contains(&(v.file_prefix, v.short)), "{}: file prefix", v.key); + assert!(FAMILY_PREFIXES.contains(&(v.key, v.short)), "{}: key prefix", v.key); + } +} + /// Registry entry (see `radios/registry.rs`) for the UV-5R itself. pub(crate) static DRIVER: BaofengUv5r = BaofengUv5r(&UV5R); @@ -314,8 +515,16 @@ impl RadioDriver for BaofengUv5r { } impl ImageRestorer for BaofengUv5r { + /// Judged as [`restore_image_for`] rearranges it, so a file CHIRP saved + /// passes on the same terms as one this app took. fn check_restore_image(&self, image: &[u8]) -> Result<(), String> { - check_restore_image_for(self.0, image) + check_restore_image_for(self.0, &restore_image_for(self.0, image)?) + } + + /// What [`restore_image`](ImageRestorer::restore_image) writes: CHIRP's + /// trailer and the WP970I layout's unmapped gap are not sent. + fn restore_len(&self, image: &[u8]) -> usize { + restore_image_for(self.0, image).map_or(image.len(), |i| i.len()) } fn check_restore_file_name(&self, file_name: &str) -> Result<(), String> { @@ -327,8 +536,9 @@ impl ImageRestorer for BaofengUv5r { /// stays — the file having the right shape does not make the radio on the /// cable this model. fn restore_image(&self, port: &str, image: &[u8]) -> Result<(), String> { + let image = restore_image_for(self.0, image)?; let (mut p, _magic, _ident) = self.connect(port)?; - upload_full_image(&mut *p, image, settings::aux_ranges(self.0, image)) + upload_full_image(&mut *p, &image, settings::aux_ranges(self.0, &image)) } } @@ -829,7 +1039,7 @@ pub struct DecodedChannel { } /// Decode programmed channels from an image for a sanity display. Empty slots -/// (rxfreq all 0xFF) are skipped. +/// (first rxfreq byte 0xFF) are skipped. #[cfg(test)] pub(crate) fn decode_channels(image: &[u8]) -> Vec { decode_channels_for(&UV5R, image) @@ -844,7 +1054,13 @@ pub(crate) fn decode_channels_for(v: &Variant, image: &[u8]) -> Vec [u8; ENTRY_LEN /// show only A-Z and 0-9: they displayed "Simplex" as `S` and an all-lower-case /// name as blank (#168, the CPS check). Upper case is what both sources agree /// every radio in the family can show. -fn name_bytes(name: &str) -> [u8; NAME_LEN] { +/// +/// `len` is the model's name length (7, or 6 on the UV-82WP and RT6): CHIRP +/// fills only that many cells, so the seventh of a six-character model is +/// left 0xFF, as on a blank slot. +fn name_bytes(name: &str, len: usize) -> [u8; NAME_LEN] { let mut out = [0xFFu8; NAME_LEN]; - for (i, ch) in name.to_uppercase().chars().take(NAME_LEN).enumerate() { + for (i, ch) in name.to_uppercase().chars().take(len.min(NAME_LEN)).enumerate() { out[i] = if ch.is_ascii() { ch as u8 } else { 0xFF }; } out @@ -1153,11 +1373,17 @@ fn encode_power(c: &Channel) -> u8 { /// [`encode_power`] for a family member. A tri-power model (CHIRP /// `UV5R_POWER_LEVELS3`) stores High 0, Med 1, Low 2; an unset or unknown level /// is High, as on the UV-5R. +/// +/// [`Power::HighLowAt2`] (CHIRP `_tri_band`) stores Low as 2 and anything else +/// as High 0, as `baofeng_common.set_memory` does. fn encode_power_for(v: &Variant, c: &Channel) -> u8 { let p = c.power.as_deref().unwrap_or(""); if p.eq_ignore_ascii_case("Low") { - if v.tri_power { 2 } else { 1 } - } else if v.tri_power + match v.power { + Power::HighLow => 1, + Power::HighMedLow | Power::HighLowAt2 => 2, + } + } else if v.power.has_med() && (p.eq_ignore_ascii_case("Med") || p.eq_ignore_ascii_case("Medium") || p.eq_ignore_ascii_case("Mid")) @@ -1170,13 +1396,13 @@ fn encode_power_for(v: &Variant, c: &Channel) -> u8 { /// The stored `lowpower` bits as the app's power label. fn decode_power(v: &Variant, byte14: u8) -> &'static str { - match (byte14 & 0x03, v.tri_power) { + match (byte14 & 0x03, v.power) { (0, _) => "High", - (1, true) => "Med", - (2, true) => "Low", + (1, Power::HighMedLow) => "Med", + (2, Power::HighMedLow | Power::HighLowAt2) => "Low", // CHIRP shows an out-of-range level as the first one; say Low for a // two-level radio's 1, and High for anything else unexplained. - (1, false) => "Low", + (1, Power::HighLow) => "Low", _ => "High", } } @@ -1779,8 +2005,8 @@ mod tests { #[test] fn names_uppercase_and_pad() { - assert_eq!(&name_bytes("Simplex"), b"SIMPLEX"); - assert_eq!(name_bytes("CO")[2..], [0xFF; 5]); + assert_eq!(&name_bytes("Simplex", 7), b"SIMPLEX"); + assert_eq!(name_bytes("CO", 7)[2..], [0xFF; 5]); } // ---- the Experimental family (#168) ---- @@ -1788,6 +2014,68 @@ mod tests { Channel { rx_freq: 146.520, power: Some(power.into()), ..Default::default() } } + /// `baofeng_common`'s `_tri_band` models: High 0, Low 2, and Med (which they + /// do not have) is High, as CHIRP's `set_memory` writes anything not Low. + #[test] + fn tri_band_wp970i_models_store_low_as_2() { + let s9 = &crate::radios::baofeng_uvs9x3::BAOFENG_UVS9X3; + assert_eq!(encode_power_for(s9, &ch("High")), 0); + assert_eq!(encode_power_for(s9, &ch("Med")), 0); + assert_eq!(encode_power_for(s9, &ch("Low")), 2); + assert_eq!(decode_power(s9, 0), "High"); + assert_eq!(decode_power(s9, 2), "Low"); + assert_eq!(decode_power(s9, 1), "High"); + } + + /// The WP970I class's two-level models store power as Baofeng's WP970I / + /// GT-3WP programmers do: High 0, Low 1 (CHIRP would write Low as 2, which + /// those programmers show as HIGH). Med, which they do not offer, is High; + /// a stored 2 reads as High, as the programmers show it. + #[test] + fn two_level_wp970i_models_store_power_as_the_vendor_cps_does() { + for v in [ + &crate::radios::baofeng_bfa58::BAOFENG_BFA58, + &crate::radios::baofeng_uv82wp::BAOFENG_UV82WP, + &crate::radios::baofeng_gt3wp::BAOFENG_GT3WP, + &crate::radios::retevis_rt6::RETEVIS_RT6, + &crate::radios::baofeng_uv9r::BAOFENG_UV9R, + &crate::radios::baofeng_uv9g::BAOFENG_UV9G, + ] { + assert_eq!(encode_power_for(v, &ch("High")), 0, "{}", v.key); + assert_eq!(encode_power_for(v, &ch("Low")), 1, "{}", v.key); + assert_eq!(encode_power_for(v, &ch("Med")), 0, "{}", v.key); + assert_eq!(decode_power(v, 1), "Low", "{}", v.key); + assert_eq!(decode_power(v, 2), "High", "{}", v.key); + } + } + + /// The UV-82WP and RT6 keep six characters, and the seventh cell blank. + #[test] + fn six_character_models_leave_the_seventh_cell_blank() { + let wp = &crate::radios::baofeng_uv82wp::BAOFENG_UV82WP; + let mut img = vec![0xFFu8; FULL_IMAGE_LEN]; + img[7] = 0xDD; + let slot = SlotChannel { slot: 0, name: "Simplex".into(), channel: ch("High") }; + patch_image_for(wp, &RadioModel::default(), &mut img, &[slot]); + assert_eq!(&img[NAME_BASE..NAME_BASE + 7], b"SIMPLE\xFF"); + } + + #[test] + fn a_slot_is_empty_when_its_first_byte_is_ff() { + // The pattern CHIRP's BF-A58S image holds in slots 23-127: only byte 0 + // cleared, the old record left behind. + let mut img = vec![0xFFu8; FULL_IMAGE_LEN]; + img[7] = 0xDD; + let stale = [0xFF, 0x25, 0x89, 0x25, 0x00, 0x25, 0x89, 0x25, 0, 0, 0, 0, 0, 0, 0, 0x44]; + img[CHANNEL_BASE..CHANNEL_BASE + ENTRY_LEN].copy_from_slice(&stale); + let live = [0x00, 0x25, 0x21, 0x45, 0x00, 0x25, 0x21, 0x45, 0, 0, 0, 0, 0, 0, 0, 0x44]; + img[CHANNEL_BASE + ENTRY_LEN..CHANNEL_BASE + 2 * ENTRY_LEN].copy_from_slice(&live); + let ch = decode_channels(&img); + assert_eq!(ch.len(), 1); + assert_eq!(ch[0].index, 1); + assert!((ch[0].rx_mhz - 452.125).abs() < 1e-9); + } + /// CHIRP's `UV5R_POWER_LEVELS3` is High, Med, Low = 0, 1, 2; the UV-5R's /// two levels are unchanged by the variant plumbing. #[test] @@ -1810,7 +2098,7 @@ mod tests { /// Upper case for every model: the vendor CPS shows nothing else. #[test] fn names_are_upper_case_on_every_family_member() { - assert_eq!(&name_bytes("Simplex"), b"SIMPLEX"); + assert_eq!(&name_bytes("Simplex", 7), b"SIMPLEX"); } /// The GT-5R transmits only on 144-148 / 420-450. A channel it can only diff --git a/src-tauri/src/radios/baofeng_uv5r/oracle.rs b/src-tauri/src/radios/baofeng_uv5r/oracle.rs index 87b7f91..ab27168 100644 --- a/src-tauri/src/radios/baofeng_uv5r/oracle.rs +++ b/src-tauri/src/radios/baofeng_uv5r/oracle.rs @@ -38,6 +38,17 @@ fn models() -> Vec<(&'static str, &'static Variant, &'static str)> { ("UV-6", &crate::radios::baofeng_uv6::BAOFENG_UV6, "BaofengUV6Radio"), ("GT-5R", &crate::radios::baofeng_gt5r::BAOFENG_GT5R, "RadioddityGT5RRadio"), ("UV-5G", &crate::radios::radioddity_uv5g::RADIODDITY_UV5G, "RadioddityUV5GRadio"), + // The WP970I class: CHIRP's `baofeng_wp970i.py` (the Python side picks + // the module from the variant's `chirp`). + ("BF-A58", &crate::radios::baofeng_bfa58::BAOFENG_BFA58, "BFA58"), + ("UV-82WP", &crate::radios::baofeng_uv82wp::BAOFENG_UV82WP, "UV82WP"), + ("GT-3WP", &crate::radios::baofeng_gt3wp::BAOFENG_GT3WP, "GT3WP"), + ("RT6", &crate::radios::retevis_rt6::RETEVIS_RT6, "RT6"), + ("BF-A58S", &crate::radios::baofeng_bfa58s::BAOFENG_BFA58S, "BFA58S"), + ("UV-S9X3", &crate::radios::baofeng_uvs9x3::BAOFENG_UVS9X3, "UVS9X3"), + ("5RX", &crate::radios::baofeng_5rx::BAOFENG_5RX, "BF5RXRadio"), + ("UV-9R", &crate::radios::baofeng_uv9r::BAOFENG_UV9R, "UV9R"), + ("UV-9G", &crate::radios::baofeng_uv9g::BAOFENG_UV9G, "UV9G"), ] } @@ -147,21 +158,45 @@ fn matrix(v: &Variant) -> Vec { m.push(row("rpt one", c(440.0), mem(440.0, "", 0.0))); - if v.tri_power { + if v.power.has_med() { let mut x = c(146.6); x.power = Some("Med".into()); let mut j = mem(146.6, "", 0.0); j["power"] = json!("Med"); m.push(row("MID", x, j)); } - if v.key == "radioddity_uv82x3" { + if v.key == "radioddity_uv82x3" || v.power == Power::HighLowAt2 { m.push(row("220", c(223.5), mem(223.5, "", 0.0))); } + if v.key == "baofeng_5rx" { + // The air band and 350-390: in the receiver, receive-only here. + m.push(row("AIR", c(121.5), mem(121.5, "", 0.0))); + m.push(row("UHF2", c(360.0), mem(360.0, "", 0.0))); + } m } /// A value for every schema field that is not what the base image holds, so /// every field the settings pass claims to write has to land. +fn hn5rv01(image: &[u8]) -> bool { + image.get(0x1838..0x183F) == Some(b"HN5RV01".as_slice()) +} + +/// A base in CHIRP's `baofeng_common` layout (radio 0x0000-0x2000, then the +/// 8-byte ident) as this driver's image: ident, main block, aux from 0x1EC0. +/// Layout only, for any model's image: restore's own conversion also checks +/// which model CHIRP saved the file as, which a base for every model must not. +fn as_our_layout(raw: &[u8]) -> Vec { + if raw.len() >= 0x2008 && raw[0x2007] == 0xDD && raw[7] != 0xDD { + let mut out = raw[0x2000..0x2008].to_vec(); + out.extend_from_slice(&raw[..0x1800]); + out.extend_from_slice(&raw[0x1EC0..0x2000]); + out + } else { + raw.to_vec() + } +} + fn settings_for(v: &Variant, schema: &str, base: &[u8]) -> Value { let decoded = settings::decode_settings_from_image_for(v, base, schema).unwrap(); let fields: Value = serde_json::from_str(schema).unwrap(); @@ -186,6 +221,8 @@ fn settings_for(v: &Variant, schema: &str, base: &[u8]) -> Value { "limits.vhf.upper" => json!(148), "limits.uhf.lower" => json!(420), "limits.uhf.upper" => json!(450), + "limits.vhf2.lower" => json!(220), + "limits.vhf2.upper" => json!(225), _ => { let cur = decoded.get(key).and_then(Value::as_i64).unwrap_or(-1); json!(if cur == min + 1 { (min + max) / 2 } else { min + 1 }) @@ -201,6 +238,9 @@ fn settings_for(v: &Variant, schema: &str, base: &[u8]) -> Value { "poweron_msg.line2" => json!("WORLD"), "ani.code" => json!("12345"), "ani.alarmcode" => json!("123"), + // On HN5RV01 firmware a WP970I-class model writes digits only + // (CHIRP's two drivers disagree on the rest of the map). + k if k.starts_with("pttid/") && v.chirp == Chirp::Wp970i && hn5rv01(base) => json!("135"), k if k.starts_with("pttid/") => json!("1A*#"), k => panic!("no oracle value for text field {k}"), }, @@ -213,7 +253,7 @@ fn settings_for(v: &Variant, schema: &str, base: &[u8]) -> Value { #[test] #[ignore] fn oracle() { - let raw = std::fs::read(std::env::var("UV5R_BASE").expect("set UV5R_BASE")).unwrap(); + let raw = as_our_layout(&std::fs::read(std::env::var("UV5R_BASE").expect("set UV5R_BASE")).unwrap()); let out = std::path::PathBuf::from(std::env::var("UV5R_OUT").expect("set UV5R_OUT")); let only: Option> = std::env::var("UV5R_ONLY").ok().map(|s| s.split(',').map(str::to_string).collect()); @@ -281,9 +321,43 @@ fn oracle() { std::fs::write(dir.join("matrix.json"), serde_json::to_string_pretty(&chirp).unwrap()).unwrap(); std::fs::write( dir.join("settings.json"), - serde_json::to_string_pretty(&json!({"class": class, "values": wanted})).unwrap(), + serde_json::to_string_pretty(&json!({ + "class": class, + "module": match v.chirp { Chirp::Uv5r => "uv5r", Chirp::Wp970i => "baofeng_wp970i" }, + // Power as Baofeng's WP970I / GT-3WP programmers store it, not + // as CHIRP does: channel Low 1 (CHIRP's Med), VFO power bit 7. + "cps_power": v.chirp == Chirp::Wp970i && v.power == Power::HighLow, + "values": wanted, + })) + .unwrap(), ) .unwrap(); println!("{model:8} {} memories, {n} settings -> {}", chirp.len(), dir.display()); } } + +/// The restore gate against real files: every `.img` in the directories named +/// by `UV5R_GATE_DIRS` (`:`-separated), under every family model. Prints which +/// models would take each file; a person reads the table. +#[test] +#[ignore] +fn restore_gate_on_real_files() { + let dirs = std::env::var("UV5R_GATE_DIRS").expect("set UV5R_GATE_DIRS"); + for dir in dirs.split(':') { + let mut names: Vec<_> = std::fs::read_dir(dir).unwrap().flatten().map(|e| e.path()).collect(); + names.sort(); + for p in names.into_iter().filter(|p| p.extension().is_some_and(|e| e == "img")) { + let file = std::fs::read(&p).unwrap(); + let name = p.file_name().unwrap().to_string_lossy().into_owned(); + let takers: Vec<&str> = super::family() + .iter() + .filter(|v| { + super::restore_image_for(v, &file).is_ok_and(|i| super::check_restore_image_for(v, &i).is_ok()) + && super::check_restore_file_name_for(v, &name).is_ok() + }) + .map(|v| v.key) + .collect(); + println!("{name:60} {:6} {}", file.len(), if takers.is_empty() { "-".into() } else { takers.join(",") }); + } + } +} diff --git a/src-tauri/src/radios/baofeng_uv5r/settings.rs b/src-tauri/src/radios/baofeng_uv5r/settings.rs index 5247b99..8bb07a8 100644 --- a/src-tauri/src/radios/baofeng_uv5r/settings.rs +++ b/src-tauri/src/radios/baofeng_uv5r/settings.rs @@ -27,7 +27,7 @@ use serde_json::Value; use crate::radios::driver::{SettingsCapture, SettingsReader, SettingsWriteReport, SettingsWriter}; -use super::{backup_filename_for, download, upload_and_verify, BaofengUv5r, Variant}; +use super::{backup_filename_for, download, upload_and_verify, BaofengUv5r, Chirp, Variant}; impl SettingsReader for BaofengUv5r { /// Download the full image and decode the profile's settings out of it. One @@ -221,15 +221,26 @@ const DTMF_CHARS: &[u8] = b"0123456789 *#ABCD"; /// UV-5G and UV-82X3 images carry it), where A-D come before * and #. const DTMF_CHARS_HN5RV01: &[u8] = b"0123456789ABCD*#"; -/// Which DTMF map this image's firmware uses — CHIRP decides it from the -/// firmware message's first line (image 0x1838), so it is a property of the -/// radio, not of the model picked. The digits 0-9 are the same in both, so the -/// ANI code (digits only) is unaffected. -fn dtmf_chars(image: &[u8]) -> &'static [u8] { - if image.get(0x1838..0x1838 + 7) == Some(b"HN5RV01".as_slice()) { - DTMF_CHARS_HN5RV01 - } else { - DTMF_CHARS +/// The digits alone: the part of a DTMF code both maps above agree on. +const DTMF_DIGITS: &[u8] = b"0123456789"; + +/// Which DTMF map this image's firmware uses — CHIRP's `uv5r.py` decides it +/// from the firmware message's first line (image 0x1838), so it is a property +/// of the radio, not of the model picked. The digits 0-9 are the same in both, +/// so the ANI code (digits only) is unaffected. +/// +/// CHIRP's `baofeng_wp970i.py` never switches: it uses `DTMF_CHARS` on every +/// firmware, including `HN5RV011`, which its own UV-S9X3 and 5RX test images +/// carry. Two CHIRP drivers disagreeing on the same firmware is an encoding +/// nobody has settled, so on a WP970I-class model with that firmware only the +/// digits are used: a code is read or written only when every character is a +/// digit, and left exactly as read otherwise. +fn dtmf_chars(v: &Variant, image: &[u8]) -> &'static [u8] { + let hn5rv01 = image.get(0x1838..0x1838 + 7) == Some(b"HN5RV01".as_slice()); + match (v.chirp, hn5rv01) { + (Chirp::Uv5r, true) => DTMF_CHARS_HN5RV01, + (Chirp::Wp970i, true) => DTMF_DIGITS, + (_, false) => DTMF_CHARS, } } @@ -246,6 +257,9 @@ enum Loc { Offset(usize), /// Two big-endian BCD bytes at `off` (band limit, MHz). Integer value. Bbcd(usize), + /// `width` bits at `shift` in the byte at `off`, where select option `i` + /// stores `values[i]` (the BF-A58S class's VFO power: High 0, Low 2). + Mapped(usize, u8, u8, &'static [u8]), /// DTMF code: `len` bytes at `off`, each a `DTMF_CHARS` index; pad 0xFF. Dtmf(usize, usize), /// ASCII text (power-on message): `len` bytes at `off`; pad 0xFF. @@ -311,6 +325,9 @@ fn loc_for(key: &str, orig: bool) -> Option { "voice" => Loc::Byte(SETTINGS + 0x0E), "dtmfst" => Loc::Byte(SETTINGS + 0x10), "screv" => Loc::Bits(SETTINGS + 0x12, 0, 2), + // When to send the PTT ID (Off / BOT / EOT / Both). The WP970I class + // offers it (`settings.pttid`); `uv5r.py` does not. + "pttid" => Loc::Byte(SETTINGS + 0x13), "pttlt" => Loc::Byte(SETTINGS + 0x14), "mdfa" => Loc::Byte(SETTINGS + 0x15), "mdfb" => Loc::Byte(SETTINGS + 0x16), @@ -365,6 +382,10 @@ fn loc_for(key: &str, orig: bool) -> Option { // bits of the same byte. "vfoa.txpower3" => Loc::Bits(VFOA + 0x17, 0, 2), "vfob.txpower3" => Loc::Bits(VFOB + 0x17, 0, 2), + // The BF-A58S class (`baofeng_common` `_tri_band`): the same two bits, + // High 0 and Low 2 (CHIRP `TXP_VALUES`). + "vfoa.txpower_hilo" => Loc::Mapped(VFOA + 0x17, 0, 2, &[0x00, 0x02]), + "vfob.txpower_hilo" => Loc::Mapped(VFOB + 0x17, 0, 2, &[0x00, 0x02]), "vfoa.widenarr" => Loc::Bits(VFOA + 0x17, 6, 1), "vfob.widenarr" => Loc::Bits(VFOB + 0x17, 6, 1), // ---- DTMF / ANI ---- @@ -383,6 +404,10 @@ fn loc_for(key: &str, orig: bool) -> Option { "limits.uhf.enable" => Loc::Byte(LIMITS + 5), "limits.uhf.lower" => Loc::Bbcd(LIMITS + 6), "limits.uhf.upper" => Loc::Bbcd(LIMITS + 8), + // The 220 band's limits on the BF-A58S class (`baofeng_wp970i.py` + // `limits.vhf2`, the third `limit` struct after vhf and uhf). + "limits.vhf2.lower" => Loc::Bbcd(LIMITS + 0x0B), + "limits.vhf2.upper" => Loc::Bbcd(LIMITS + 0x0D), _ => return None, }) } @@ -450,7 +475,7 @@ pub fn apply_profile_settings_for( .as_object() .ok_or("profile settings is not a JSON object")?; - let dtmf = dtmf_chars(image); + let dtmf = dtmf_chars(v, image); let mut applied = 0usize; for (key, value) in obj { if STEP_KEYS.contains(&key.as_str()) @@ -488,6 +513,12 @@ fn apply_one( Some(n) => put_bbcd2(image, *off, n.max(0) as u32), None => false, }, + Loc::Mapped(off, shift, width, values) => { + match resolve_int(key, value, options).and_then(|i| values.get(i as usize)) { + Some(&n) => put_bits(image, *off, *shift, *width, n), + None => false, + } + } Loc::Freq { off, band } => match value.as_str().map(str::trim) { Some(s) if !s.is_empty() => put_freq(image, *off, *band, s), _ => false, // blank VFO frequency: leave as read @@ -497,6 +528,13 @@ fn apply_one( _ => false, }, Loc::Dtmf(off, len) => match value.as_str() { + // Blank is "not set", not "clear the code": the form saves an + // untouched field as "", and a code the digits-only map hides + // shows blank (see `read_value`), so writing it would wipe it. + Some(s) if s.trim().is_empty() => false, + // On the digits-only map (see `dtmf_chars`) a code with anything + // else in it is left as read rather than written with gaps. + Some(s) if dtmf == DTMF_DIGITS && !s.bytes().all(|c| dtmf.contains(&c)) => false, Some(s) => put_dtmf(image, *off, *len, s, dtmf), None => false, }, @@ -675,7 +713,7 @@ pub fn decode_settings_from_image(image: &[u8], schema_json: &str) -> Result Result { let orig = is_orig(v, image); let fields = parse_fields(schema_json)?; - let dtmf = dtmf_chars(image); + let dtmf = dtmf_chars(v, image); let mut map = serde_json::Map::new(); for (key, def) in fields { if STEP_KEYS.contains(&key.as_str()) && def.options.len() != step_list_len(orig) { @@ -739,9 +777,27 @@ fn read_value(image: &[u8], loc: &Loc, def: &FieldDef, dtmf: &[u8]) -> Option { + let b = *image.get(*off)?; + let mask = ((1u16 << width) - 1) as u8; + let stored = (b >> shift) & mask; + // A value outside the map is shown as nothing, not guessed. + let i = values.iter().position(|&x| x == stored)?; + numeric(i as i64) + } Loc::Freq { off, .. } => Some(Value::String(read_digits_mhz(image, *off, 8, 10))), Loc::Offset(off) => Some(Value::String(read_digits_mhz(image, *off, 6, 1000))), - Loc::Dtmf(off, len) => Some(Value::String(read_dtmf(image, *off, *len, dtmf))), + Loc::Dtmf(off, len) => { + // On the digits-only map, a stored code holding anything but digits + // is not shown: dropping the characters it cannot name and writing + // the rest back would change the code. + let end = (*off + *len).min(image.len()); + let cells = image.get(*off..end)?; + if dtmf == DTMF_DIGITS && cells.iter().any(|&b| b < 0x1F && b as usize >= dtmf.len()) { + return None; + } + Some(Value::String(read_dtmf(image, *off, *len, dtmf))) + } Loc::Text(off, len) => Some(Value::String(read_text(image, *off, *len))), } } @@ -989,26 +1045,57 @@ mod tests { assert_eq!(&img[VFOA..VFOA + 8], &[4, 4, 6, 0, 0, 0, 0, 0]); assert_eq!(img[VFOA + 0x12] & 0x01, 1); // 446 MHz >= 400 -> band bit set } + + /// The WP970I class sets the band bit too, although CHIRP's + /// `baofeng_wp970i` leaves it as read. Its radio-authored images (BF-A58S, + /// 5RX, UV-S9X3, UV-9G) store VFO B on UHF with band 1, and the vendor + /// WP970I / GT-3WP CPS writes 1 with UHF -- and refuses a UHF frequency + /// while the band says VHF. + #[test] + fn wp970i_class_vfo_frequency_sets_the_band_bit() { + let schema = r#"[{"key":"vfob.freq","type":"text"}]"#; + let mut img = blank(); + apply_profile_settings_for(&crate::radios::baofeng_uv9r::BAOFENG_UV9R, &mut img, schema, r#"{"vfob.freq":"446.125"}"#) + .unwrap(); + assert_eq!(img[VFOB + 0x12] & 0x01, 1); + apply_profile_settings_for(&crate::radios::baofeng_uv9r::BAOFENG_UV9R, &mut img, schema, r#"{"vfob.freq":"146.520"}"#) + .unwrap(); + assert_eq!(img[VFOB + 0x12] & 0x01, 0); + } + + /// The two-level WP970I models' VFO power is bit 7 of VFO+0x17, where + /// Baofeng's GT-3WP programmer wrote LOW (0x41 -> 0xC1 on each VFO), not + /// CHIRP's `txpower3` bits 0-1. Their generated schema must name it. + #[test] + fn two_level_wp970i_vfo_power_is_bit_7() { + let uv9r = &crate::radios::baofeng_uv9r::BAOFENG_UV9R; + let schema = crate::seed::UV9R_SETTINGS_SCHEMA; + assert!(!schema.contains("txpower3")); + let mut img = blank(); + img[VFOA + 0x17] = 0x41; + img[VFOB + 0x17] = 0x41; + apply_profile_settings_for(uv9r, &mut img, schema, r#"{"vfoa.txpower":"Low","vfob.txpower":"Low"}"#) + .unwrap(); + assert_eq!(img[VFOA + 0x17], 0xC1); + assert_eq!(img[VFOB + 0x17], 0xC1); + } + /// Every key in every family schema is one the encoder can locate, and /// every select's options fit the bits it is stored in. A key `loc()` does /// not know is a form field that silently does nothing; an option list /// longer than its field writes the wrong value into the neighbouring bits. #[test] fn family_schemas_only_name_keys_the_encoder_knows() { - let schemas = [ - ("UV-5R", crate::seed::model_capability_rows() - .into_iter() - .find(|(n, _, _)| *n == "Baofeng UV-5R") - .unwrap() - .2), - ("UV-82", crate::seed::UV82_SETTINGS_SCHEMA), - ("UV-82HP", crate::seed::UV82HP_SETTINGS_SCHEMA), - ("UV-82X3", crate::seed::UV82X3_SETTINGS_SCHEMA), - ("BF-F8HP", crate::seed::BFF8HP_SETTINGS_SCHEMA), - ("UV-6", crate::seed::UV6_SETTINGS_SCHEMA), - ("GT-5R", crate::seed::GT5R_SETTINGS_SCHEMA), - ("UV-5G", crate::seed::UV5G_SETTINGS_SCHEMA), - ]; + // Every family member, by its seed row: a model added to the family + // list is checked here without this test being edited. + let rows = crate::seed::model_capability_rows(); + let schemas: Vec<(&str, &str)> = super::super::family() + .iter() + .map(|v| { + let row = rows.iter().find(|(n, _, _)| *n == v.display_name); + (v.short, row.unwrap_or_else(|| panic!("{} is not seeded", v.display_name)).2) + }) + .collect(); for (name, schema) in schemas { let fields: Value = serde_json::from_str(schema).unwrap(); for f in fields.as_array().unwrap() { @@ -1021,6 +1108,7 @@ mod tests { let room = match loc { Loc::Bits(_, _, width) => 1usize << width, Loc::Byte(_) => 256, + Loc::Mapped(_, _, _, values) => values.len(), _ => panic!("{name}: {key} is a select on a non-integer field"), }; assert!(opts.len() <= room, "{name}: {key} has {} options in {room}", opts.len()); @@ -1069,6 +1157,29 @@ mod tests { assert_eq!(&hn[PTTID..PTTID + 3], &[1, 10, 14]); assert_eq!(decode_settings_from_image(&hn, schema).unwrap()["pttid/0.code"], "1A*"); } + + /// A blank DTMF field is "not set": the code stays as read. On a WP970I + /// model with HN5RV01 firmware a code holding A-D, * or # is not shown, so + /// the form saves it as "", and writing that would wipe the radio's code. + #[test] + fn a_blank_dtmf_field_leaves_the_code_as_read() { + let schema = r#"[{"key":"pttid/0.code","type":"text"}]"#; + let s9 = &crate::radios::baofeng_uvs9x3::BAOFENG_UVS9X3; + let mut hn = blank(); + hn[0x1838..0x1838 + 7].copy_from_slice(b"HN5RV01"); + hn[PTTID..PTTID + 5].copy_from_slice(&[1, 2, 10, 0xFF, 0xFF]); + let shown = decode_settings_from_image_for(s9, &hn, schema).unwrap(); + assert!(shown.get("pttid/0.code").is_none()); + for blank_value in [r#"{"pttid/0.code":""}"#, r#"{"pttid/0.code":" "}"#] { + assert_eq!(apply_profile_settings_for(s9, &mut hn, schema, blank_value).unwrap(), 0); + assert_eq!(&hn[PTTID..PTTID + 5], &[1, 2, 10, 0xFF, 0xFF]); + } + // The UV-5R too: blank never clears a code. + let mut img = blank(); + img[PTTID..PTTID + 3].copy_from_slice(&[1, 2, 3]); + apply_profile_settings(&mut img, schema, r#"{"pttid/0.code":""}"#).unwrap(); + assert_eq!(&img[PTTID..PTTID + 3], &[1, 2, 3]); + } /// An image whose firmware string says BFB251, as Tim's UV-5R's does, with /// that radio's own `limits_old` bytes (identical in all 40 of its backups: /// VHF on, 136-174; UHF on, 400-479) and the `limits_new` zeros 39 of them diff --git a/src-tauri/src/radios/baofeng_uv6/mod.rs b/src-tauri/src/radios/baofeng_uv6/mod.rs index 9ebea7e..f219c0f 100644 --- a/src-tauri/src/radios/baofeng_uv6/mod.rs +++ b/src-tauri/src/radios/baofeng_uv6/mod.rs @@ -10,7 +10,7 @@ //! model has been confirmed on a radio, so it ships Experimental and the app //! warns before every write. See `docs/radios/baofeng-uv5r-family.md`. -use crate::radios::baofeng_uv5r::{BaofengUv5r, Variant, MAGIC_UV6, MAGIC_UV6_ORIG}; +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_UV6, MAGIC_UV6_ORIG}; pub(crate) static BAOFENG_UV6: Variant = Variant { key: "baofeng_uv6", @@ -18,8 +18,11 @@ pub(crate) static BAOFENG_UV6: Variant = Variant { short: "UV-6", idents: &[MAGIC_UV6, MAGIC_UV6_ORIG], aux_block: false, - tri_power: false, + power: Power::HighLow, + name_len: 7, + chirp: Chirp::Uv5r, orig_by_firmware: false, + chirp_models: &["UV-6"], file_prefix: "uv6", hardware_verified: false, }; diff --git a/src-tauri/src/radios/baofeng_uv82/mod.rs b/src-tauri/src/radios/baofeng_uv82/mod.rs index 93be42b..163f31f 100644 --- a/src-tauri/src/radios/baofeng_uv82/mod.rs +++ b/src-tauri/src/radios/baofeng_uv82/mod.rs @@ -9,7 +9,7 @@ //! model has been confirmed on a radio, so it ships Experimental and the app //! warns before every write. See `docs/radios/baofeng-uv5r-family.md`. -use crate::radios::baofeng_uv5r::{BaofengUv5r, Variant, MAGIC_UV82}; +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_UV82}; pub(crate) static BAOFENG_UV82: Variant = Variant { key: "baofeng_uv82", @@ -17,8 +17,11 @@ pub(crate) static BAOFENG_UV82: Variant = Variant { short: "UV-82", idents: &[MAGIC_UV82], aux_block: true, - tri_power: false, + power: Power::HighLow, + name_len: 7, + chirp: Chirp::Uv5r, orig_by_firmware: false, + chirp_models: &["UV-82"], file_prefix: "uv82", hardware_verified: false, }; diff --git a/src-tauri/src/radios/baofeng_uv82hp/mod.rs b/src-tauri/src/radios/baofeng_uv82hp/mod.rs index e66ea62..6b79e0d 100644 --- a/src-tauri/src/radios/baofeng_uv82hp/mod.rs +++ b/src-tauri/src/radios/baofeng_uv82hp/mod.rs @@ -10,7 +10,7 @@ //! model has been confirmed on a radio, so it ships Experimental and the app //! warns before every write. See `docs/radios/baofeng-uv5r-family.md`. -use crate::radios::baofeng_uv5r::{BaofengUv5r, Variant, MAGIC_UV82}; +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_UV82}; pub(crate) static BAOFENG_UV82HP: Variant = Variant { key: "baofeng_uv82hp", @@ -18,8 +18,11 @@ pub(crate) static BAOFENG_UV82HP: Variant = Variant { short: "UV-82HP", idents: &[MAGIC_UV82], aux_block: true, - tri_power: true, + power: Power::HighMedLow, + name_len: 7, + chirp: Chirp::Uv5r, orig_by_firmware: false, + chirp_models: &["UV-82HP", "UV-82 Pro"], file_prefix: "uv82hp", hardware_verified: false, }; diff --git a/src-tauri/src/radios/baofeng_uv82wp/mod.rs b/src-tauri/src/radios/baofeng_uv82wp/mod.rs new file mode 100644 index 0000000..53b97df --- /dev/null +++ b/src-tauri/src/radios/baofeng_uv82wp/mod.rs @@ -0,0 +1,32 @@ +//! Baofeng UV-82WP (`driver_key = "baofeng_uv82wp"`) — Experimental (#168). +//! +//! CHIRP `UV82WP` (`chirp/drivers/baofeng_wp970i.py`): the WP970I magic, High / Med / Low, six-character names. Power follows Baofeng's own programmer, not CHIRP: High / Low, stored 0 / 1, with VFO power in bit 7 (Tim, 2026-12-02; see the family doc). +//! +//! The radio-address map is the UV-5R's, so everything else is the +//! hardware-proven UV-5R session in `radios/baofeng_uv5r` (identify, download, +//! back up, patch, upload, read back). The model's map and its differences are +//! ported from CHIRP's `baofeng_wp970i.py` and `baofeng_common.py` +//! (GPLv2-or-later, by Jim Unroe and the CHIRP contributors). Nobody here owns +//! one: nothing about this model has been confirmed on a radio, so it ships +//! Experimental and the app warns before every write. See +//! `docs/radios/baofeng-uv5r-family.md`. + +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_WP970I}; + +pub(crate) static BAOFENG_UV82WP: Variant = Variant { + key: "baofeng_uv82wp", + display_name: "Baofeng UV-82WP", + short: "UV-82WP", + idents: &[MAGIC_WP970I], + aux_block: true, + power: Power::HighLow, + name_len: 6, + chirp: Chirp::Wp970i, + orig_by_firmware: false, + chirp_models: &["UV-82WP"], + file_prefix: "uv82wp", + hardware_verified: false, +}; + +/// Registry entry (see `radios/registry.rs`). +pub(crate) static DRIVER: BaofengUv5r = BaofengUv5r(&BAOFENG_UV82WP); diff --git a/src-tauri/src/radios/baofeng_uv9g/mod.rs b/src-tauri/src/radios/baofeng_uv9g/mod.rs new file mode 100644 index 0000000..3de79a6 --- /dev/null +++ b/src-tauri/src/radios/baofeng_uv9g/mod.rs @@ -0,0 +1,32 @@ +//! Baofeng UV-9G (`driver_key = "baofeng_uv9g"`) — Experimental (#168). +//! +//! CHIRP `UV9G` (`chirp/drivers/baofeng_wp970i.py`): its own magic, High / Med / Low (5 / 1 / 0.5 W). Sold for GMRS; CHIRP treats it as full-band (`_gmrs = False`). Power follows Baofeng's own programmer, not CHIRP: High / Low, stored 0 / 1, with VFO power in bit 7 (Tim, 2026-12-02; see the family doc). +//! +//! The radio-address map is the UV-5R's, so everything else is the +//! hardware-proven UV-5R session in `radios/baofeng_uv5r` (identify, download, +//! back up, patch, upload, read back). The model's map and its differences are +//! ported from CHIRP's `baofeng_wp970i.py` and `baofeng_common.py` +//! (GPLv2-or-later, by Jim Unroe and the CHIRP contributors). Nobody here owns +//! one: nothing about this model has been confirmed on a radio, so it ships +//! Experimental and the app warns before every write. See +//! `docs/radios/baofeng-uv5r-family.md`. + +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_UV9G}; + +pub(crate) static BAOFENG_UV9G: Variant = Variant { + key: "baofeng_uv9g", + display_name: "Baofeng UV-9G", + short: "UV-9G", + idents: &[MAGIC_UV9G], + aux_block: true, + power: Power::HighLow, + name_len: 7, + chirp: Chirp::Wp970i, + orig_by_firmware: false, + chirp_models: &["UV-9G"], + file_prefix: "uv9g", + hardware_verified: false, +}; + +/// Registry entry (see `radios/registry.rs`). +pub(crate) static DRIVER: BaofengUv5r = BaofengUv5r(&BAOFENG_UV9G); diff --git a/src-tauri/src/radios/baofeng_uv9r/mod.rs b/src-tauri/src/radios/baofeng_uv9r/mod.rs new file mode 100644 index 0000000..8810e41 --- /dev/null +++ b/src-tauri/src/radios/baofeng_uv9r/mod.rs @@ -0,0 +1,32 @@ +//! Baofeng UV-9R (`driver_key = "baofeng_uv9r"`) — Experimental (#168). +//! +//! CHIRP `UV9R` (`chirp/drivers/baofeng_wp970i.py`): the WP970I magic, High / Med / Low, seven-character names. Power follows Baofeng's own programmer, not CHIRP: High / Low, stored 0 / 1, with VFO power in bit 7 (Tim, 2026-12-02; see the family doc). +//! +//! The radio-address map is the UV-5R's, so everything else is the +//! hardware-proven UV-5R session in `radios/baofeng_uv5r` (identify, download, +//! back up, patch, upload, read back). The model's map and its differences are +//! ported from CHIRP's `baofeng_wp970i.py` and `baofeng_common.py` +//! (GPLv2-or-later, by Jim Unroe and the CHIRP contributors). Nobody here owns +//! one: nothing about this model has been confirmed on a radio, so it ships +//! Experimental and the app warns before every write. See +//! `docs/radios/baofeng-uv5r-family.md`. + +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_WP970I}; + +pub(crate) static BAOFENG_UV9R: Variant = Variant { + key: "baofeng_uv9r", + display_name: "Baofeng UV-9R", + short: "UV-9R", + idents: &[MAGIC_WP970I], + aux_block: true, + power: Power::HighLow, + name_len: 7, + chirp: Chirp::Wp970i, + orig_by_firmware: false, + chirp_models: &["UV-9R"], + file_prefix: "uv9r", + hardware_verified: false, +}; + +/// Registry entry (see `radios/registry.rs`). +pub(crate) static DRIVER: BaofengUv5r = BaofengUv5r(&BAOFENG_UV9R); diff --git a/src-tauri/src/radios/baofeng_uvs9x3/mod.rs b/src-tauri/src/radios/baofeng_uvs9x3/mod.rs new file mode 100644 index 0000000..d46a5f2 --- /dev/null +++ b/src-tauri/src/radios/baofeng_uvs9x3/mod.rs @@ -0,0 +1,32 @@ +//! Baofeng UV-S9X3 (`driver_key = "baofeng_uvs9x3"`) — Experimental (#168). +//! +//! CHIRP `UVS9X3` (`chirp/drivers/baofeng_wp970i.py`): the UV-S9X3 magic (byte for byte the UV-5R's 291 magic), tri-band, High / Low stored as 0 / 2. +//! +//! The radio-address map is the UV-5R's, so everything else is the +//! hardware-proven UV-5R session in `radios/baofeng_uv5r` (identify, download, +//! back up, patch, upload, read back). The model's map and its differences are +//! ported from CHIRP's `baofeng_wp970i.py` and `baofeng_common.py` +//! (GPLv2-or-later, by Jim Unroe and the CHIRP contributors). Nobody here owns +//! one: nothing about this model has been confirmed on a radio, so it ships +//! Experimental and the app warns before every write. See +//! `docs/radios/baofeng-uv5r-family.md`. + +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_UVS9X3}; + +pub(crate) static BAOFENG_UVS9X3: Variant = Variant { + key: "baofeng_uvs9x3", + display_name: "Baofeng UV-S9X3", + short: "UV-S9X3", + idents: &[MAGIC_UVS9X3], + aux_block: true, + power: Power::HighLowAt2, + name_len: 7, + chirp: Chirp::Wp970i, + orig_by_firmware: false, + chirp_models: &["UV-S9X3"], + file_prefix: "uvs9x3", + hardware_verified: false, +}; + +/// Registry entry (see `radios/registry.rs`). +pub(crate) static DRIVER: BaofengUv5r = BaofengUv5r(&BAOFENG_UVS9X3); diff --git a/src-tauri/src/radios/driver.rs b/src-tauri/src/radios/driver.rs index 01c87e9..e732bf9 100644 --- a/src-tauri/src/radios/driver.rs +++ b/src-tauri/src/radios/driver.rs @@ -651,6 +651,13 @@ pub(crate) trait ImageRestorer: Send + Sync { /// protocols hand the ident straight to the block writer, and a proven /// one-session flow must not become two to satisfy a trait shape. fn restore_image(&self, port: &str, image: &[u8]) -> Result<(), String>; + + /// How many bytes [`restore_image`](Self::restore_image) puts on the radio + /// from this file, for the report. The file's length, unless the driver + /// rearranges it first (the UV-5R family drops CHIRP's metadata trailer). + fn restore_len(&self, image: &[u8]) -> usize { + image.len() + } } /// Radios with an on-board DMR contacts / call-sign database (AnyTone D890UV). diff --git a/src-tauri/src/radios/mod.rs b/src-tauri/src/radios/mod.rs index 7244fdd..a90adc3 100644 --- a/src-tauri/src/radios/mod.rs +++ b/src-tauri/src/radios/mod.rs @@ -40,6 +40,15 @@ pub(crate) mod baofeng_bff8hp; pub(crate) mod baofeng_uv6; pub(crate) mod baofeng_gt5r; pub(crate) mod radioddity_uv5g; +pub(crate) mod baofeng_bfa58; +pub(crate) mod baofeng_uv82wp; +pub(crate) mod baofeng_gt3wp; +pub(crate) mod retevis_rt6; +pub(crate) mod baofeng_bfa58s; +pub(crate) mod baofeng_uvs9x3; +pub(crate) mod baofeng_5rx; +pub(crate) mod baofeng_uv9r; +pub(crate) mod baofeng_uv9g; pub(crate) mod binteradio_bt9000; pub(crate) mod card_file; #[cfg(test)] diff --git a/src-tauri/src/radios/radioddity_uv5g/mod.rs b/src-tauri/src/radios/radioddity_uv5g/mod.rs index 0e7d5d5..2f1048b 100644 --- a/src-tauri/src/radios/radioddity_uv5g/mod.rs +++ b/src-tauri/src/radios/radioddity_uv5g/mod.rs @@ -11,7 +11,7 @@ //! model has been confirmed on a radio, so it ships Experimental and the app //! warns before every write. See `docs/radios/baofeng-uv5r-family.md`. -use crate::radios::baofeng_uv5r::{BaofengUv5r, Variant, MAGIC_UV5G}; +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_UV5G}; pub(crate) static RADIODDITY_UV5G: Variant = Variant { key: "radioddity_uv5g", @@ -19,8 +19,11 @@ pub(crate) static RADIODDITY_UV5G: Variant = Variant { short: "UV-5G", idents: &[MAGIC_UV5G], aux_block: true, - tri_power: false, + power: Power::HighLow, + name_len: 7, + chirp: Chirp::Uv5r, orig_by_firmware: true, + chirp_models: &["UV-5G"], file_prefix: "uv5g", hardware_verified: false, }; diff --git a/src-tauri/src/radios/radioddity_uv82x3/mod.rs b/src-tauri/src/radios/radioddity_uv82x3/mod.rs index 7eeb205..6dc5d86 100644 --- a/src-tauri/src/radios/radioddity_uv82x3/mod.rs +++ b/src-tauri/src/radios/radioddity_uv82x3/mod.rs @@ -10,7 +10,7 @@ //! model has been confirmed on a radio, so it ships Experimental and the app //! warns before every write. See `docs/radios/baofeng-uv5r-family.md`. -use crate::radios::baofeng_uv5r::{BaofengUv5r, Variant, MAGIC_UV82}; +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_UV82}; pub(crate) static RADIODDITY_UV82X3: Variant = Variant { key: "radioddity_uv82x3", @@ -18,8 +18,11 @@ pub(crate) static RADIODDITY_UV82X3: Variant = Variant { short: "UV-82X3", idents: &[MAGIC_UV82], aux_block: true, - tri_power: false, + power: Power::HighLow, + name_len: 7, + chirp: Chirp::Uv5r, orig_by_firmware: false, + chirp_models: &["UV-82X3"], file_prefix: "uv82x3", hardware_verified: false, }; diff --git a/src-tauri/src/radios/registry.rs b/src-tauri/src/radios/registry.rs index cc170f8..245db85 100644 --- a/src-tauri/src/radios/registry.rs +++ b/src-tauri/src/radios/registry.rs @@ -23,7 +23,7 @@ use crate::models::RadioModel; /// Every driver compiled into the app. Order is not significant — lookups are /// by `key()`, which is unique. (A static array rather than a slice literal: /// references to statics aren't const-promotable inside a returned temporary.) -static DRIVERS: [&dyn RadioDriver; 28] = [ +static DRIVERS: [&dyn RadioDriver; 37] = [ &super::baofeng_uv5r::DRIVER, &super::baofeng_uv82::DRIVER, &super::baofeng_uv82hp::DRIVER, @@ -32,6 +32,15 @@ static DRIVERS: [&dyn RadioDriver; 28] = [ &super::baofeng_uv6::DRIVER, &super::baofeng_gt5r::DRIVER, &super::radioddity_uv5g::DRIVER, + &super::baofeng_bfa58::DRIVER, + &super::baofeng_uv82wp::DRIVER, + &super::baofeng_gt3wp::DRIVER, + &super::retevis_rt6::DRIVER, + &super::baofeng_bfa58s::DRIVER, + &super::baofeng_uvs9x3::DRIVER, + &super::baofeng_5rx::DRIVER, + &super::baofeng_uv9r::DRIVER, + &super::baofeng_uv9g::DRIVER, &super::binteradio_bt9000::DRIVER, &super::tidradio_tdh3::DRIVER, &super::anytone_atd890uv::DRIVER, @@ -284,6 +293,15 @@ mod tests { | "baofeng_uv6" | "baofeng_gt5r" | "radioddity_uv5g" + | "baofeng_bfa58" + | "baofeng_uv82wp" + | "baofeng_gt3wp" + | "retevis_rt6" + | "baofeng_bfa58s" + | "baofeng_uvs9x3" + | "baofeng_5rx" + | "baofeng_uv9r" + | "baofeng_uv9g" | "tidradio_tdh3" | "kenwood_thd72" | "binteradio_bt9000" diff --git a/src-tauri/src/radios/retevis_rt6/mod.rs b/src-tauri/src/radios/retevis_rt6/mod.rs new file mode 100644 index 0000000..aadf30e --- /dev/null +++ b/src-tauri/src/radios/retevis_rt6/mod.rs @@ -0,0 +1,32 @@ +//! Retevis RT6 (`driver_key = "retevis_rt6"`) — Experimental (#168). +//! +//! CHIRP `RT6` (`chirp/drivers/baofeng_wp970i.py`): the WP970I magic, High / Med / Low, six-character names. Power follows Baofeng's own programmer, not CHIRP: High / Low, stored 0 / 1, with VFO power in bit 7 (Tim, 2026-12-02; see the family doc). +//! +//! The radio-address map is the UV-5R's, so everything else is the +//! hardware-proven UV-5R session in `radios/baofeng_uv5r` (identify, download, +//! back up, patch, upload, read back). The model's map and its differences are +//! ported from CHIRP's `baofeng_wp970i.py` and `baofeng_common.py` +//! (GPLv2-or-later, by Jim Unroe and the CHIRP contributors). Nobody here owns +//! one: nothing about this model has been confirmed on a radio, so it ships +//! Experimental and the app warns before every write. See +//! `docs/radios/baofeng-uv5r-family.md`. + +use crate::radios::baofeng_uv5r::{BaofengUv5r, Chirp, Power, Variant, MAGIC_WP970I}; + +pub(crate) static RETEVIS_RT6: Variant = Variant { + key: "retevis_rt6", + display_name: "Retevis RT6", + short: "RT6", + idents: &[MAGIC_WP970I], + aux_block: true, + power: Power::HighLow, + name_len: 6, + chirp: Chirp::Wp970i, + orig_by_firmware: false, + chirp_models: &["RT6"], + file_prefix: "rt6", + hardware_verified: false, +}; + +/// Registry entry (see `radios/registry.rs`). +pub(crate) static DRIVER: BaofengUv5r = BaofengUv5r(&RETEVIS_RT6); diff --git a/src-tauri/src/rt6_settings_schema.json b/src-tauri/src/rt6_settings_schema.json new file mode 100644 index 0000000..3210dc0 --- /dev/null +++ b/src-tauri/src/rt6_settings_schema.json @@ -0,0 +1,1111 @@ +[ + { + "key": "section-general", + "label": "General", + "type": "section", + "group": "General" + }, + { + "key": "save", + "label": "Battery Saver", + "type": "select", + "options": [ + "Off", + "1:1", + "1:2", + "1:3", + "1:4" + ] + }, + { + "key": "autolk", + "label": "Automatic Key Lock", + "type": "boolean" + }, + { + "key": "keylock", + "label": "Keypad Lock", + "type": "boolean" + }, + { + "key": "almod", + "label": "Alarm Mode", + "type": "select", + "options": [ + "Site", + "Tone", + "Code" + ] + }, + { + "key": "alarm", + "label": "Alarm Sound", + "type": "boolean" + }, + { + "key": "fmradio", + "label": "Broadcast FM Radio", + "type": "boolean" + }, + { + "key": "reset", + "label": "RESET Menu Enabled", + "type": "boolean" + }, + { + "key": "menu", + "label": "All Menus Enabled", + "type": "boolean" + }, + { + "key": "section-display", + "label": "Display", + "type": "section", + "group": "Display" + }, + { + "key": "abr", + "label": "Backlight Timeout", + "type": "select", + "options": [ + "Off", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "mdfa", + "label": "Display Mode (A)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "mdfb", + "label": "Display Mode (B)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "displayab", + "label": "Display Side", + "type": "select", + "options": [ + "A", + "B" + ] + }, + { + "key": "wtled", + "label": "Standby LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "rxled", + "label": "RX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "txled", + "label": "TX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "poweron_msg.line1", + "label": "Power-On Message Line 1", + "type": "text", + "max_length": 7 + }, + { + "key": "poweron_msg.line2", + "label": "Power-On Message Line 2", + "type": "text", + "max_length": 7 + }, + { + "key": "section-sounds", + "label": "Sounds", + "type": "section", + "group": "Sounds" + }, + { + "key": "beep", + "label": "Key Beep", + "type": "boolean" + }, + { + "key": "roger", + "label": "Roger Beep", + "type": "boolean" + }, + { + "key": "voice", + "label": "Voice Prompt", + "type": "select", + "options": [ + "Off", + "English", + "Chinese" + ] + }, + { + "key": "section-transmit-and-receive", + "label": "Transmit & Receive", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "squelch", + "label": "Carrier Squelch Level", + "type": "integer", + "min": 0, + "max": 9 + }, + { + "key": "timeout", + "label": "Timeout Timer", + "type": "select", + "options": [ + "15 sec", + "30 sec", + "45 sec", + "60 sec", + "75 sec", + "90 sec", + "105 sec", + "120 sec", + "135 sec", + "150 sec", + "165 sec", + "180 sec", + "195 sec", + "210 sec", + "225 sec", + "240 sec", + "255 sec", + "270 sec", + "285 sec", + "300 sec", + "315 sec", + "330 sec", + "345 sec", + "360 sec", + "375 sec", + "390 sec", + "405 sec", + "420 sec", + "435 sec", + "450 sec", + "465 sec", + "480 sec", + "495 sec", + "510 sec", + "525 sec", + "540 sec", + "555 sec", + "570 sec", + "585 sec", + "600 sec" + ] + }, + { + "key": "vox", + "label": "VOX Sensitivity", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "tdr", + "label": "Dual Watch", + "type": "boolean" + }, + { + "key": "tdrab", + "label": "Dual Watch TX Priority", + "type": "select", + "options": [ + "Off", + "A", + "B" + ] + }, + { + "key": "ste", + "label": "Squelch Tail Eliminate (HT to HT)", + "type": "boolean" + }, + { + "key": "rpste", + "label": "Squelch Tail Eliminate (repeater)", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "rptrl", + "label": "STE Repeater Delay", + "type": "select", + "options": [ + "OFF", + "100 ms", + "200 ms", + "300 ms", + "400 ms", + "500 ms", + "600 ms", + "700 ms", + "800 ms", + "900 ms", + "1000 ms" + ] + }, + { + "key": "section-band-limits", + "label": "Band Limits", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "limits.vhf.lower", + "label": "VHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf.upper", + "label": "VHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.lower", + "label": "UHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.upper", + "label": "UHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "section-memory-and-vfo", + "label": "Memory & VFO", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "workmode", + "label": "VFO/MR Mode", + "type": "select", + "options": [ + "Frequency", + "Channel" + ] + }, + { + "key": "wmchannel.mrcha", + "label": "MR A Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "wmchannel.mrchb", + "label": "MR B Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "section-vfo", + "label": "VFO A / B", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "vfoa.freq", + "label": "VFO A Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.freq", + "label": "VFO B Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.sftd", + "label": "VFO A Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfob.sftd", + "label": "VFO B Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfoa.offset", + "label": "VFO A Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.offset", + "label": "VFO B Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.txpower", + "label": "VFO A Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfob.txpower", + "label": "VFO B Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfoa.widenarr", + "label": "VFO A Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfob.widenarr", + "label": "VFO B Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfoa.scode", + "label": "VFO A PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfob.scode", + "label": "VFO B PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfoa.step", + "label": "VFO A Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "vfob.step", + "label": "VFO B Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "section-scan", + "label": "Scan", + "type": "section", + "group": "Scan" + }, + { + "key": "screv", + "label": "Scan Resume", + "type": "select", + "options": [ + "TO", + "CO", + "SE" + ] + }, + { + "key": "section-dtmf", + "label": "DTMF & ANI", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "dtmfst", + "label": "DTMF Sidetone", + "type": "select", + "options": [ + "OFF", + "DT-ST", + "ANI-ST", + "DT+ANI" + ] + }, + { + "key": "pttid", + "label": "When to send PTT ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "ani.dtmfon", + "label": "DTMF Speed (on)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "ani.dtmfoff", + "label": "DTMF Speed (off)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "pttlt", + "label": "PTT ID Delay", + "type": "integer", + "min": 0, + "max": 50 + }, + { + "key": "ani.code", + "label": "ANI Code", + "type": "text", + "max_length": 5 + }, + { + "key": "ani.aniid", + "label": "ANI ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "section-ptt-id-codes", + "label": "PTT ID Codes", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "pttid/0.code", + "label": "PTT ID Code 1", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/1.code", + "label": "PTT ID Code 2", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/2.code", + "label": "PTT ID Code 3", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/3.code", + "label": "PTT ID Code 4", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/4.code", + "label": "PTT ID Code 5", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/5.code", + "label": "PTT ID Code 6", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/6.code", + "label": "PTT ID Code 7", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/7.code", + "label": "PTT ID Code 8", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/8.code", + "label": "PTT ID Code 9", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/9.code", + "label": "PTT ID Code 10", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/10.code", + "label": "PTT ID Code 11", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/11.code", + "label": "PTT ID Code 12", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/12.code", + "label": "PTT ID Code 13", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/13.code", + "label": "PTT ID Code 14", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/14.code", + "label": "PTT ID Code 15", + "type": "text", + "max_length": 5 + } +] diff --git a/src-tauri/src/seed.rs b/src-tauri/src/seed.rs index ae5165b..59dd04e 100644 --- a/src-tauri/src/seed.rs +++ b/src-tauri/src/seed.rs @@ -228,6 +228,16 @@ pub const BFF8HP_SETTINGS_SCHEMA: &str = include_str!("bff8hp_settings_schema.js pub const UV6_SETTINGS_SCHEMA: &str = include_str!("uv6_settings_schema.json"); pub const GT5R_SETTINGS_SCHEMA: &str = include_str!("gt5r_settings_schema.json"); pub const UV5G_SETTINGS_SCHEMA: &str = include_str!("uv5g_settings_schema.json"); +/// The WP970I class (#168): the same generator, `baofeng_wp970i.py`'s differences. +pub const BFA58_SETTINGS_SCHEMA: &str = include_str!("bfa58_settings_schema.json"); +pub const UV82WP_SETTINGS_SCHEMA: &str = include_str!("uv82wp_settings_schema.json"); +pub const GT3WP_SETTINGS_SCHEMA: &str = include_str!("gt3wp_settings_schema.json"); +pub const RT6_SETTINGS_SCHEMA: &str = include_str!("rt6_settings_schema.json"); +pub const BFA58S_SETTINGS_SCHEMA: &str = include_str!("bfa58s_settings_schema.json"); +pub const UVS9X3_SETTINGS_SCHEMA: &str = include_str!("uvs9x3_settings_schema.json"); +pub const BF5RX_SETTINGS_SCHEMA: &str = include_str!("5rx_settings_schema.json"); +pub const UV9R_SETTINGS_SCHEMA: &str = include_str!("uv9r_settings_schema.json"); +pub const UV9G_SETTINGS_SCHEMA: &str = include_str!("uv9g_settings_schema.json"); #[cfg(test)] @@ -665,6 +675,367 @@ fn models() -> Vec { non_channel_settings_schema: UV5G_SETTINGS_SCHEMA, }, // -------------------------------------------------------- + // Baofeng BF-A58 — Experimental (#168), on the UV-5R's driver code with + // CHIRP `baofeng_wp970i.py`'s map. CHIRP `BFA58`: valid_bands 130-180 / 400-521, High / Med / Low. + // Power: High / Low (0 / 1) as Baofeng's programmer stores it, not CHIRP's three levels. + // -------------------------------------------------------- + ModelSeed { + manufacturer: "Baofeng", + model: "BF-A58", + driver_key: Some("baofeng_bfa58"), + programming_ui: Some("generic"), + display_name: "Baofeng BF-A58", + analog_capable: true, + dmr_capable: false, + dstar_capable: false, + ysf_capable: false, + nxdn_capable: false, + p25_capable: false, + m17_capable: false, + aprs_capable: false, + covers_hf: false, + covers_vhf: true, + covers_uhf: true, + covers_220: false, + covers_900: false, + freq_min: 130.0, + freq_max: 521.0, + tx_bands: Some("[[130.0,180.0],[400.0,521.0]]"), + rx_bands: None, + memory_channels: 128, + zones_supported: false, + max_zones: None, + channels_per_zone: None, + scan_lists_supported: false, + max_scan_lists: None, + banks_supported: false, + max_name_length: 7, + export_format: "chirp_csv", + connection_type: "Kenwood K1 (2-pin)", + non_channel_settings_schema: BFA58_SETTINGS_SCHEMA, + }, + // -------------------------------------------------------- + // Baofeng UV-82WP — Experimental (#168), on the UV-5R's driver code with + // CHIRP `baofeng_wp970i.py`'s map. CHIRP `UV82WP`: 130-180 / 400-521, High / Med / Low, six-character names. + // Power: High / Low (0 / 1) as Baofeng's programmer stores it, not CHIRP's three levels. + // -------------------------------------------------------- + ModelSeed { + manufacturer: "Baofeng", + model: "UV-82WP", + driver_key: Some("baofeng_uv82wp"), + programming_ui: Some("generic"), + display_name: "Baofeng UV-82WP", + analog_capable: true, + dmr_capable: false, + dstar_capable: false, + ysf_capable: false, + nxdn_capable: false, + p25_capable: false, + m17_capable: false, + aprs_capable: false, + covers_hf: false, + covers_vhf: true, + covers_uhf: true, + covers_220: false, + covers_900: false, + freq_min: 130.0, + freq_max: 521.0, + tx_bands: Some("[[130.0,180.0],[400.0,521.0]]"), + rx_bands: None, + memory_channels: 128, + zones_supported: false, + max_zones: None, + channels_per_zone: None, + scan_lists_supported: false, + max_scan_lists: None, + banks_supported: false, + max_name_length: 6, + export_format: "chirp_csv", + connection_type: "Kenwood K1 (2-pin)", + non_channel_settings_schema: UV82WP_SETTINGS_SCHEMA, + }, + // -------------------------------------------------------- + // Baofeng GT-3WP — Experimental (#168), on the UV-5R's driver code with + // CHIRP `baofeng_wp970i.py`'s map. CHIRP `GT3WP`: 130-180 / 400-521, High / Med / Low. + // Power: High / Low (0 / 1) as Baofeng's programmer stores it, not CHIRP's three levels. + // -------------------------------------------------------- + ModelSeed { + manufacturer: "Baofeng", + model: "GT-3WP", + driver_key: Some("baofeng_gt3wp"), + programming_ui: Some("generic"), + display_name: "Baofeng GT-3WP", + analog_capable: true, + dmr_capable: false, + dstar_capable: false, + ysf_capable: false, + nxdn_capable: false, + p25_capable: false, + m17_capable: false, + aprs_capable: false, + covers_hf: false, + covers_vhf: true, + covers_uhf: true, + covers_220: false, + covers_900: false, + freq_min: 130.0, + freq_max: 521.0, + tx_bands: Some("[[130.0,180.0],[400.0,521.0]]"), + rx_bands: None, + memory_channels: 128, + zones_supported: false, + max_zones: None, + channels_per_zone: None, + scan_lists_supported: false, + max_scan_lists: None, + banks_supported: false, + max_name_length: 7, + export_format: "chirp_csv", + connection_type: "Kenwood K1 (2-pin)", + non_channel_settings_schema: GT3WP_SETTINGS_SCHEMA, + }, + // -------------------------------------------------------- + // Retevis RT6 — Experimental (#168), on the UV-5R's driver code with + // CHIRP `baofeng_wp970i.py`'s map. CHIRP `RT6`: 130-180 / 400-521, High / Med / Low, six-character names. + // Power: High / Low (0 / 1) as Baofeng's programmer stores it, not CHIRP's three levels. + // -------------------------------------------------------- + ModelSeed { + manufacturer: "Retevis", + model: "RT6", + driver_key: Some("retevis_rt6"), + programming_ui: Some("generic"), + display_name: "Retevis RT6", + analog_capable: true, + dmr_capable: false, + dstar_capable: false, + ysf_capable: false, + nxdn_capable: false, + p25_capable: false, + m17_capable: false, + aprs_capable: false, + covers_hf: false, + covers_vhf: true, + covers_uhf: true, + covers_220: false, + covers_900: false, + freq_min: 130.0, + freq_max: 521.0, + tx_bands: Some("[[130.0,180.0],[400.0,521.0]]"), + rx_bands: None, + memory_channels: 128, + zones_supported: false, + max_zones: None, + channels_per_zone: None, + scan_lists_supported: false, + max_scan_lists: None, + banks_supported: false, + max_name_length: 6, + export_format: "chirp_csv", + connection_type: "Kenwood K1 (2-pin)", + non_channel_settings_schema: RT6_SETTINGS_SCHEMA, + }, + // -------------------------------------------------------- + // Baofeng BF-A58S — Experimental (#168), on the UV-5R's driver code with + // CHIRP `baofeng_wp970i.py`'s map. CHIRP `BFA58S`: 130-180 / 200-260 / 400-521, High / Low. + // -------------------------------------------------------- + ModelSeed { + manufacturer: "Baofeng", + model: "BF-A58S", + driver_key: Some("baofeng_bfa58s"), + programming_ui: Some("generic"), + display_name: "Baofeng BF-A58S", + analog_capable: true, + dmr_capable: false, + dstar_capable: false, + ysf_capable: false, + nxdn_capable: false, + p25_capable: false, + m17_capable: false, + aprs_capable: false, + covers_hf: false, + covers_vhf: true, + covers_uhf: true, + covers_220: true, + covers_900: false, + freq_min: 130.0, + freq_max: 521.0, + tx_bands: Some("[[130.0,180.0],[200.0,260.0],[400.0,521.0]]"), + rx_bands: None, + memory_channels: 128, + zones_supported: false, + max_zones: None, + channels_per_zone: None, + scan_lists_supported: false, + max_scan_lists: None, + banks_supported: false, + max_name_length: 7, + export_format: "chirp_csv", + connection_type: "Kenwood K1 (2-pin)", + non_channel_settings_schema: BFA58S_SETTINGS_SCHEMA, + }, + // -------------------------------------------------------- + // Baofeng UV-S9X3 — Experimental (#168), on the UV-5R's driver code with + // CHIRP `baofeng_wp970i.py`'s map. CHIRP `UVS9X3`: 130-180 / 200-260 / 400-521, High / Low. + // -------------------------------------------------------- + ModelSeed { + manufacturer: "Baofeng", + model: "UV-S9X3", + driver_key: Some("baofeng_uvs9x3"), + programming_ui: Some("generic"), + display_name: "Baofeng UV-S9X3", + analog_capable: true, + dmr_capable: false, + dstar_capable: false, + ysf_capable: false, + nxdn_capable: false, + p25_capable: false, + m17_capable: false, + aprs_capable: false, + covers_hf: false, + covers_vhf: true, + covers_uhf: true, + covers_220: true, + covers_900: false, + freq_min: 130.0, + freq_max: 521.0, + tx_bands: Some("[[130.0,180.0],[200.0,260.0],[400.0,521.0]]"), + rx_bands: None, + memory_channels: 128, + zones_supported: false, + max_zones: None, + channels_per_zone: None, + scan_lists_supported: false, + max_scan_lists: None, + banks_supported: false, + max_name_length: 7, + export_format: "chirp_csv", + connection_type: "Kenwood K1 (2-pin)", + non_channel_settings_schema: UVS9X3_SETTINGS_SCHEMA, + }, + // -------------------------------------------------------- + // Baofeng 5RX — Experimental (#168), on the UV-5R's driver code with + // CHIRP `baofeng_wp970i.py`'s map. CHIRP `BF5RXRadio`: valid_bands 108-136 / 136-174 / 200-260 / 350-390 / + // 400-520, High / Low. CHIRP does not say which of those transmit; the + // air band and 350-390 are taken as receive-only here, so a channel there + // is written with no TX frequency rather than able to key up. + // -------------------------------------------------------- + ModelSeed { + manufacturer: "Baofeng", + model: "5RX", + driver_key: Some("baofeng_5rx"), + programming_ui: Some("generic"), + display_name: "Baofeng 5RX", + analog_capable: true, + dmr_capable: false, + dstar_capable: false, + ysf_capable: false, + nxdn_capable: false, + p25_capable: false, + m17_capable: false, + aprs_capable: false, + covers_hf: false, + covers_vhf: true, + covers_uhf: true, + covers_220: true, + covers_900: false, + freq_min: 108.0, + freq_max: 520.0, + tx_bands: Some("[[136.0,174.0],[200.0,260.0],[400.0,520.0]]"), + rx_bands: Some("[[108.0,174.0],[200.0,260.0],[350.0,390.0],[400.0,520.0]]"), + memory_channels: 128, + zones_supported: false, + max_zones: None, + channels_per_zone: None, + scan_lists_supported: false, + max_scan_lists: None, + banks_supported: false, + max_name_length: 7, + export_format: "chirp_csv", + connection_type: "Kenwood K1 (2-pin)", + non_channel_settings_schema: BF5RX_SETTINGS_SCHEMA, + }, + // -------------------------------------------------------- + // Baofeng UV-9R — Experimental (#168), on the UV-5R's driver code with + // CHIRP `baofeng_wp970i.py`'s map. CHIRP `UV9R`: 130-180 / 400-521, High / Med / Low. + // Power: High / Low (0 / 1) as Baofeng's programmer stores it, not CHIRP's three levels. + // -------------------------------------------------------- + ModelSeed { + manufacturer: "Baofeng", + model: "UV-9R", + driver_key: Some("baofeng_uv9r"), + programming_ui: Some("generic"), + display_name: "Baofeng UV-9R", + analog_capable: true, + dmr_capable: false, + dstar_capable: false, + ysf_capable: false, + nxdn_capable: false, + p25_capable: false, + m17_capable: false, + aprs_capable: false, + covers_hf: false, + covers_vhf: true, + covers_uhf: true, + covers_220: false, + covers_900: false, + freq_min: 130.0, + freq_max: 521.0, + tx_bands: Some("[[130.0,180.0],[400.0,521.0]]"), + rx_bands: None, + memory_channels: 128, + zones_supported: false, + max_zones: None, + channels_per_zone: None, + scan_lists_supported: false, + max_scan_lists: None, + banks_supported: false, + max_name_length: 7, + export_format: "chirp_csv", + connection_type: "Kenwood K1 (2-pin)", + non_channel_settings_schema: UV9R_SETTINGS_SCHEMA, + }, + // -------------------------------------------------------- + // Baofeng UV-9G — Experimental (#168), on the UV-5R's driver code with + // CHIRP `baofeng_wp970i.py`'s map. CHIRP `UV9G`: 130-180 / 400-521, High / Med / Low (5 / 1 / 0.5 W). Sold for GMRS; + // CHIRP treats it as full band (`_gmrs = False`). + // Power: High / Low (0 / 1) as Baofeng's programmer stores it, not CHIRP's three levels. + // -------------------------------------------------------- + ModelSeed { + manufacturer: "Baofeng", + model: "UV-9G", + driver_key: Some("baofeng_uv9g"), + programming_ui: Some("generic"), + display_name: "Baofeng UV-9G", + analog_capable: true, + dmr_capable: false, + dstar_capable: false, + ysf_capable: false, + nxdn_capable: false, + p25_capable: false, + m17_capable: false, + aprs_capable: false, + covers_hf: false, + covers_vhf: true, + covers_uhf: true, + covers_220: false, + covers_900: false, + freq_min: 130.0, + freq_max: 521.0, + tx_bands: Some("[[130.0,180.0],[400.0,521.0]]"), + rx_bands: None, + memory_channels: 128, + zones_supported: false, + max_zones: None, + channels_per_zone: None, + scan_lists_supported: false, + max_scan_lists: None, + banks_supported: false, + max_name_length: 7, + export_format: "chirp_csv", + connection_type: "Kenwood K1 (2-pin)", + non_channel_settings_schema: UV9G_SETTINGS_SCHEMA, + }, + // -------------------------------------------------------- // 9. Binteradio BT-9000 (issue #43) — analog FM/NFM/AM clone-mode HT. // One badge on an OEM platform also sold as the Radtel RT-950 Pro, // Bajeton BJ-9000 and Tenway TP-900 Pro; the radio reports its model diff --git a/src-tauri/src/uv82wp_settings_schema.json b/src-tauri/src/uv82wp_settings_schema.json new file mode 100644 index 0000000..3210dc0 --- /dev/null +++ b/src-tauri/src/uv82wp_settings_schema.json @@ -0,0 +1,1111 @@ +[ + { + "key": "section-general", + "label": "General", + "type": "section", + "group": "General" + }, + { + "key": "save", + "label": "Battery Saver", + "type": "select", + "options": [ + "Off", + "1:1", + "1:2", + "1:3", + "1:4" + ] + }, + { + "key": "autolk", + "label": "Automatic Key Lock", + "type": "boolean" + }, + { + "key": "keylock", + "label": "Keypad Lock", + "type": "boolean" + }, + { + "key": "almod", + "label": "Alarm Mode", + "type": "select", + "options": [ + "Site", + "Tone", + "Code" + ] + }, + { + "key": "alarm", + "label": "Alarm Sound", + "type": "boolean" + }, + { + "key": "fmradio", + "label": "Broadcast FM Radio", + "type": "boolean" + }, + { + "key": "reset", + "label": "RESET Menu Enabled", + "type": "boolean" + }, + { + "key": "menu", + "label": "All Menus Enabled", + "type": "boolean" + }, + { + "key": "section-display", + "label": "Display", + "type": "section", + "group": "Display" + }, + { + "key": "abr", + "label": "Backlight Timeout", + "type": "select", + "options": [ + "Off", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "mdfa", + "label": "Display Mode (A)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "mdfb", + "label": "Display Mode (B)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "displayab", + "label": "Display Side", + "type": "select", + "options": [ + "A", + "B" + ] + }, + { + "key": "wtled", + "label": "Standby LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "rxled", + "label": "RX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "txled", + "label": "TX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "poweron_msg.line1", + "label": "Power-On Message Line 1", + "type": "text", + "max_length": 7 + }, + { + "key": "poweron_msg.line2", + "label": "Power-On Message Line 2", + "type": "text", + "max_length": 7 + }, + { + "key": "section-sounds", + "label": "Sounds", + "type": "section", + "group": "Sounds" + }, + { + "key": "beep", + "label": "Key Beep", + "type": "boolean" + }, + { + "key": "roger", + "label": "Roger Beep", + "type": "boolean" + }, + { + "key": "voice", + "label": "Voice Prompt", + "type": "select", + "options": [ + "Off", + "English", + "Chinese" + ] + }, + { + "key": "section-transmit-and-receive", + "label": "Transmit & Receive", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "squelch", + "label": "Carrier Squelch Level", + "type": "integer", + "min": 0, + "max": 9 + }, + { + "key": "timeout", + "label": "Timeout Timer", + "type": "select", + "options": [ + "15 sec", + "30 sec", + "45 sec", + "60 sec", + "75 sec", + "90 sec", + "105 sec", + "120 sec", + "135 sec", + "150 sec", + "165 sec", + "180 sec", + "195 sec", + "210 sec", + "225 sec", + "240 sec", + "255 sec", + "270 sec", + "285 sec", + "300 sec", + "315 sec", + "330 sec", + "345 sec", + "360 sec", + "375 sec", + "390 sec", + "405 sec", + "420 sec", + "435 sec", + "450 sec", + "465 sec", + "480 sec", + "495 sec", + "510 sec", + "525 sec", + "540 sec", + "555 sec", + "570 sec", + "585 sec", + "600 sec" + ] + }, + { + "key": "vox", + "label": "VOX Sensitivity", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "tdr", + "label": "Dual Watch", + "type": "boolean" + }, + { + "key": "tdrab", + "label": "Dual Watch TX Priority", + "type": "select", + "options": [ + "Off", + "A", + "B" + ] + }, + { + "key": "ste", + "label": "Squelch Tail Eliminate (HT to HT)", + "type": "boolean" + }, + { + "key": "rpste", + "label": "Squelch Tail Eliminate (repeater)", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "rptrl", + "label": "STE Repeater Delay", + "type": "select", + "options": [ + "OFF", + "100 ms", + "200 ms", + "300 ms", + "400 ms", + "500 ms", + "600 ms", + "700 ms", + "800 ms", + "900 ms", + "1000 ms" + ] + }, + { + "key": "section-band-limits", + "label": "Band Limits", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "limits.vhf.lower", + "label": "VHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf.upper", + "label": "VHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.lower", + "label": "UHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.upper", + "label": "UHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "section-memory-and-vfo", + "label": "Memory & VFO", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "workmode", + "label": "VFO/MR Mode", + "type": "select", + "options": [ + "Frequency", + "Channel" + ] + }, + { + "key": "wmchannel.mrcha", + "label": "MR A Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "wmchannel.mrchb", + "label": "MR B Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "section-vfo", + "label": "VFO A / B", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "vfoa.freq", + "label": "VFO A Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.freq", + "label": "VFO B Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.sftd", + "label": "VFO A Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfob.sftd", + "label": "VFO B Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfoa.offset", + "label": "VFO A Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.offset", + "label": "VFO B Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.txpower", + "label": "VFO A Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfob.txpower", + "label": "VFO B Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfoa.widenarr", + "label": "VFO A Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfob.widenarr", + "label": "VFO B Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfoa.scode", + "label": "VFO A PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfob.scode", + "label": "VFO B PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfoa.step", + "label": "VFO A Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "vfob.step", + "label": "VFO B Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "section-scan", + "label": "Scan", + "type": "section", + "group": "Scan" + }, + { + "key": "screv", + "label": "Scan Resume", + "type": "select", + "options": [ + "TO", + "CO", + "SE" + ] + }, + { + "key": "section-dtmf", + "label": "DTMF & ANI", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "dtmfst", + "label": "DTMF Sidetone", + "type": "select", + "options": [ + "OFF", + "DT-ST", + "ANI-ST", + "DT+ANI" + ] + }, + { + "key": "pttid", + "label": "When to send PTT ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "ani.dtmfon", + "label": "DTMF Speed (on)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "ani.dtmfoff", + "label": "DTMF Speed (off)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "pttlt", + "label": "PTT ID Delay", + "type": "integer", + "min": 0, + "max": 50 + }, + { + "key": "ani.code", + "label": "ANI Code", + "type": "text", + "max_length": 5 + }, + { + "key": "ani.aniid", + "label": "ANI ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "section-ptt-id-codes", + "label": "PTT ID Codes", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "pttid/0.code", + "label": "PTT ID Code 1", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/1.code", + "label": "PTT ID Code 2", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/2.code", + "label": "PTT ID Code 3", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/3.code", + "label": "PTT ID Code 4", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/4.code", + "label": "PTT ID Code 5", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/5.code", + "label": "PTT ID Code 6", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/6.code", + "label": "PTT ID Code 7", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/7.code", + "label": "PTT ID Code 8", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/8.code", + "label": "PTT ID Code 9", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/9.code", + "label": "PTT ID Code 10", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/10.code", + "label": "PTT ID Code 11", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/11.code", + "label": "PTT ID Code 12", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/12.code", + "label": "PTT ID Code 13", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/13.code", + "label": "PTT ID Code 14", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/14.code", + "label": "PTT ID Code 15", + "type": "text", + "max_length": 5 + } +] diff --git a/src-tauri/src/uv9g_settings_schema.json b/src-tauri/src/uv9g_settings_schema.json new file mode 100644 index 0000000..3210dc0 --- /dev/null +++ b/src-tauri/src/uv9g_settings_schema.json @@ -0,0 +1,1111 @@ +[ + { + "key": "section-general", + "label": "General", + "type": "section", + "group": "General" + }, + { + "key": "save", + "label": "Battery Saver", + "type": "select", + "options": [ + "Off", + "1:1", + "1:2", + "1:3", + "1:4" + ] + }, + { + "key": "autolk", + "label": "Automatic Key Lock", + "type": "boolean" + }, + { + "key": "keylock", + "label": "Keypad Lock", + "type": "boolean" + }, + { + "key": "almod", + "label": "Alarm Mode", + "type": "select", + "options": [ + "Site", + "Tone", + "Code" + ] + }, + { + "key": "alarm", + "label": "Alarm Sound", + "type": "boolean" + }, + { + "key": "fmradio", + "label": "Broadcast FM Radio", + "type": "boolean" + }, + { + "key": "reset", + "label": "RESET Menu Enabled", + "type": "boolean" + }, + { + "key": "menu", + "label": "All Menus Enabled", + "type": "boolean" + }, + { + "key": "section-display", + "label": "Display", + "type": "section", + "group": "Display" + }, + { + "key": "abr", + "label": "Backlight Timeout", + "type": "select", + "options": [ + "Off", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "mdfa", + "label": "Display Mode (A)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "mdfb", + "label": "Display Mode (B)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "displayab", + "label": "Display Side", + "type": "select", + "options": [ + "A", + "B" + ] + }, + { + "key": "wtled", + "label": "Standby LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "rxled", + "label": "RX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "txled", + "label": "TX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "poweron_msg.line1", + "label": "Power-On Message Line 1", + "type": "text", + "max_length": 7 + }, + { + "key": "poweron_msg.line2", + "label": "Power-On Message Line 2", + "type": "text", + "max_length": 7 + }, + { + "key": "section-sounds", + "label": "Sounds", + "type": "section", + "group": "Sounds" + }, + { + "key": "beep", + "label": "Key Beep", + "type": "boolean" + }, + { + "key": "roger", + "label": "Roger Beep", + "type": "boolean" + }, + { + "key": "voice", + "label": "Voice Prompt", + "type": "select", + "options": [ + "Off", + "English", + "Chinese" + ] + }, + { + "key": "section-transmit-and-receive", + "label": "Transmit & Receive", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "squelch", + "label": "Carrier Squelch Level", + "type": "integer", + "min": 0, + "max": 9 + }, + { + "key": "timeout", + "label": "Timeout Timer", + "type": "select", + "options": [ + "15 sec", + "30 sec", + "45 sec", + "60 sec", + "75 sec", + "90 sec", + "105 sec", + "120 sec", + "135 sec", + "150 sec", + "165 sec", + "180 sec", + "195 sec", + "210 sec", + "225 sec", + "240 sec", + "255 sec", + "270 sec", + "285 sec", + "300 sec", + "315 sec", + "330 sec", + "345 sec", + "360 sec", + "375 sec", + "390 sec", + "405 sec", + "420 sec", + "435 sec", + "450 sec", + "465 sec", + "480 sec", + "495 sec", + "510 sec", + "525 sec", + "540 sec", + "555 sec", + "570 sec", + "585 sec", + "600 sec" + ] + }, + { + "key": "vox", + "label": "VOX Sensitivity", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "tdr", + "label": "Dual Watch", + "type": "boolean" + }, + { + "key": "tdrab", + "label": "Dual Watch TX Priority", + "type": "select", + "options": [ + "Off", + "A", + "B" + ] + }, + { + "key": "ste", + "label": "Squelch Tail Eliminate (HT to HT)", + "type": "boolean" + }, + { + "key": "rpste", + "label": "Squelch Tail Eliminate (repeater)", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "rptrl", + "label": "STE Repeater Delay", + "type": "select", + "options": [ + "OFF", + "100 ms", + "200 ms", + "300 ms", + "400 ms", + "500 ms", + "600 ms", + "700 ms", + "800 ms", + "900 ms", + "1000 ms" + ] + }, + { + "key": "section-band-limits", + "label": "Band Limits", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "limits.vhf.lower", + "label": "VHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf.upper", + "label": "VHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.lower", + "label": "UHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.upper", + "label": "UHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "section-memory-and-vfo", + "label": "Memory & VFO", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "workmode", + "label": "VFO/MR Mode", + "type": "select", + "options": [ + "Frequency", + "Channel" + ] + }, + { + "key": "wmchannel.mrcha", + "label": "MR A Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "wmchannel.mrchb", + "label": "MR B Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "section-vfo", + "label": "VFO A / B", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "vfoa.freq", + "label": "VFO A Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.freq", + "label": "VFO B Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.sftd", + "label": "VFO A Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfob.sftd", + "label": "VFO B Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfoa.offset", + "label": "VFO A Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.offset", + "label": "VFO B Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.txpower", + "label": "VFO A Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfob.txpower", + "label": "VFO B Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfoa.widenarr", + "label": "VFO A Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfob.widenarr", + "label": "VFO B Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfoa.scode", + "label": "VFO A PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfob.scode", + "label": "VFO B PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfoa.step", + "label": "VFO A Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "vfob.step", + "label": "VFO B Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "section-scan", + "label": "Scan", + "type": "section", + "group": "Scan" + }, + { + "key": "screv", + "label": "Scan Resume", + "type": "select", + "options": [ + "TO", + "CO", + "SE" + ] + }, + { + "key": "section-dtmf", + "label": "DTMF & ANI", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "dtmfst", + "label": "DTMF Sidetone", + "type": "select", + "options": [ + "OFF", + "DT-ST", + "ANI-ST", + "DT+ANI" + ] + }, + { + "key": "pttid", + "label": "When to send PTT ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "ani.dtmfon", + "label": "DTMF Speed (on)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "ani.dtmfoff", + "label": "DTMF Speed (off)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "pttlt", + "label": "PTT ID Delay", + "type": "integer", + "min": 0, + "max": 50 + }, + { + "key": "ani.code", + "label": "ANI Code", + "type": "text", + "max_length": 5 + }, + { + "key": "ani.aniid", + "label": "ANI ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "section-ptt-id-codes", + "label": "PTT ID Codes", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "pttid/0.code", + "label": "PTT ID Code 1", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/1.code", + "label": "PTT ID Code 2", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/2.code", + "label": "PTT ID Code 3", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/3.code", + "label": "PTT ID Code 4", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/4.code", + "label": "PTT ID Code 5", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/5.code", + "label": "PTT ID Code 6", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/6.code", + "label": "PTT ID Code 7", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/7.code", + "label": "PTT ID Code 8", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/8.code", + "label": "PTT ID Code 9", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/9.code", + "label": "PTT ID Code 10", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/10.code", + "label": "PTT ID Code 11", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/11.code", + "label": "PTT ID Code 12", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/12.code", + "label": "PTT ID Code 13", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/13.code", + "label": "PTT ID Code 14", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/14.code", + "label": "PTT ID Code 15", + "type": "text", + "max_length": 5 + } +] diff --git a/src-tauri/src/uv9r_settings_schema.json b/src-tauri/src/uv9r_settings_schema.json new file mode 100644 index 0000000..3210dc0 --- /dev/null +++ b/src-tauri/src/uv9r_settings_schema.json @@ -0,0 +1,1111 @@ +[ + { + "key": "section-general", + "label": "General", + "type": "section", + "group": "General" + }, + { + "key": "save", + "label": "Battery Saver", + "type": "select", + "options": [ + "Off", + "1:1", + "1:2", + "1:3", + "1:4" + ] + }, + { + "key": "autolk", + "label": "Automatic Key Lock", + "type": "boolean" + }, + { + "key": "keylock", + "label": "Keypad Lock", + "type": "boolean" + }, + { + "key": "almod", + "label": "Alarm Mode", + "type": "select", + "options": [ + "Site", + "Tone", + "Code" + ] + }, + { + "key": "alarm", + "label": "Alarm Sound", + "type": "boolean" + }, + { + "key": "fmradio", + "label": "Broadcast FM Radio", + "type": "boolean" + }, + { + "key": "reset", + "label": "RESET Menu Enabled", + "type": "boolean" + }, + { + "key": "menu", + "label": "All Menus Enabled", + "type": "boolean" + }, + { + "key": "section-display", + "label": "Display", + "type": "section", + "group": "Display" + }, + { + "key": "abr", + "label": "Backlight Timeout", + "type": "select", + "options": [ + "Off", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "mdfa", + "label": "Display Mode (A)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "mdfb", + "label": "Display Mode (B)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "displayab", + "label": "Display Side", + "type": "select", + "options": [ + "A", + "B" + ] + }, + { + "key": "wtled", + "label": "Standby LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "rxled", + "label": "RX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "txled", + "label": "TX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "poweron_msg.line1", + "label": "Power-On Message Line 1", + "type": "text", + "max_length": 7 + }, + { + "key": "poweron_msg.line2", + "label": "Power-On Message Line 2", + "type": "text", + "max_length": 7 + }, + { + "key": "section-sounds", + "label": "Sounds", + "type": "section", + "group": "Sounds" + }, + { + "key": "beep", + "label": "Key Beep", + "type": "boolean" + }, + { + "key": "roger", + "label": "Roger Beep", + "type": "boolean" + }, + { + "key": "voice", + "label": "Voice Prompt", + "type": "select", + "options": [ + "Off", + "English", + "Chinese" + ] + }, + { + "key": "section-transmit-and-receive", + "label": "Transmit & Receive", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "squelch", + "label": "Carrier Squelch Level", + "type": "integer", + "min": 0, + "max": 9 + }, + { + "key": "timeout", + "label": "Timeout Timer", + "type": "select", + "options": [ + "15 sec", + "30 sec", + "45 sec", + "60 sec", + "75 sec", + "90 sec", + "105 sec", + "120 sec", + "135 sec", + "150 sec", + "165 sec", + "180 sec", + "195 sec", + "210 sec", + "225 sec", + "240 sec", + "255 sec", + "270 sec", + "285 sec", + "300 sec", + "315 sec", + "330 sec", + "345 sec", + "360 sec", + "375 sec", + "390 sec", + "405 sec", + "420 sec", + "435 sec", + "450 sec", + "465 sec", + "480 sec", + "495 sec", + "510 sec", + "525 sec", + "540 sec", + "555 sec", + "570 sec", + "585 sec", + "600 sec" + ] + }, + { + "key": "vox", + "label": "VOX Sensitivity", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "tdr", + "label": "Dual Watch", + "type": "boolean" + }, + { + "key": "tdrab", + "label": "Dual Watch TX Priority", + "type": "select", + "options": [ + "Off", + "A", + "B" + ] + }, + { + "key": "ste", + "label": "Squelch Tail Eliminate (HT to HT)", + "type": "boolean" + }, + { + "key": "rpste", + "label": "Squelch Tail Eliminate (repeater)", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "rptrl", + "label": "STE Repeater Delay", + "type": "select", + "options": [ + "OFF", + "100 ms", + "200 ms", + "300 ms", + "400 ms", + "500 ms", + "600 ms", + "700 ms", + "800 ms", + "900 ms", + "1000 ms" + ] + }, + { + "key": "section-band-limits", + "label": "Band Limits", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "limits.vhf.lower", + "label": "VHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf.upper", + "label": "VHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.lower", + "label": "UHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.upper", + "label": "UHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "section-memory-and-vfo", + "label": "Memory & VFO", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "workmode", + "label": "VFO/MR Mode", + "type": "select", + "options": [ + "Frequency", + "Channel" + ] + }, + { + "key": "wmchannel.mrcha", + "label": "MR A Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "wmchannel.mrchb", + "label": "MR B Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "section-vfo", + "label": "VFO A / B", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "vfoa.freq", + "label": "VFO A Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.freq", + "label": "VFO B Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.sftd", + "label": "VFO A Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfob.sftd", + "label": "VFO B Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfoa.offset", + "label": "VFO A Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.offset", + "label": "VFO B Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.txpower", + "label": "VFO A Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfob.txpower", + "label": "VFO B Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfoa.widenarr", + "label": "VFO A Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfob.widenarr", + "label": "VFO B Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfoa.scode", + "label": "VFO A PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfob.scode", + "label": "VFO B PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfoa.step", + "label": "VFO A Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "vfob.step", + "label": "VFO B Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "section-scan", + "label": "Scan", + "type": "section", + "group": "Scan" + }, + { + "key": "screv", + "label": "Scan Resume", + "type": "select", + "options": [ + "TO", + "CO", + "SE" + ] + }, + { + "key": "section-dtmf", + "label": "DTMF & ANI", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "dtmfst", + "label": "DTMF Sidetone", + "type": "select", + "options": [ + "OFF", + "DT-ST", + "ANI-ST", + "DT+ANI" + ] + }, + { + "key": "pttid", + "label": "When to send PTT ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "ani.dtmfon", + "label": "DTMF Speed (on)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "ani.dtmfoff", + "label": "DTMF Speed (off)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "pttlt", + "label": "PTT ID Delay", + "type": "integer", + "min": 0, + "max": 50 + }, + { + "key": "ani.code", + "label": "ANI Code", + "type": "text", + "max_length": 5 + }, + { + "key": "ani.aniid", + "label": "ANI ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "section-ptt-id-codes", + "label": "PTT ID Codes", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "pttid/0.code", + "label": "PTT ID Code 1", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/1.code", + "label": "PTT ID Code 2", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/2.code", + "label": "PTT ID Code 3", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/3.code", + "label": "PTT ID Code 4", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/4.code", + "label": "PTT ID Code 5", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/5.code", + "label": "PTT ID Code 6", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/6.code", + "label": "PTT ID Code 7", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/7.code", + "label": "PTT ID Code 8", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/8.code", + "label": "PTT ID Code 9", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/9.code", + "label": "PTT ID Code 10", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/10.code", + "label": "PTT ID Code 11", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/11.code", + "label": "PTT ID Code 12", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/12.code", + "label": "PTT ID Code 13", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/13.code", + "label": "PTT ID Code 14", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/14.code", + "label": "PTT ID Code 15", + "type": "text", + "max_length": 5 + } +] diff --git a/src-tauri/src/uvs9x3_settings_schema.json b/src-tauri/src/uvs9x3_settings_schema.json new file mode 100644 index 0000000..6171ca2 --- /dev/null +++ b/src-tauri/src/uvs9x3_settings_schema.json @@ -0,0 +1,1125 @@ +[ + { + "key": "section-general", + "label": "General", + "type": "section", + "group": "General" + }, + { + "key": "save", + "label": "Battery Saver", + "type": "select", + "options": [ + "Off", + "1:1", + "1:2", + "1:3", + "1:4" + ] + }, + { + "key": "autolk", + "label": "Automatic Key Lock", + "type": "boolean" + }, + { + "key": "keylock", + "label": "Keypad Lock", + "type": "boolean" + }, + { + "key": "almod", + "label": "Alarm Mode", + "type": "select", + "options": [ + "Site", + "Tone", + "Code" + ] + }, + { + "key": "alarm", + "label": "Alarm Sound", + "type": "boolean" + }, + { + "key": "fmradio", + "label": "Broadcast FM Radio", + "type": "boolean" + }, + { + "key": "reset", + "label": "RESET Menu Enabled", + "type": "boolean" + }, + { + "key": "menu", + "label": "All Menus Enabled", + "type": "boolean" + }, + { + "key": "section-display", + "label": "Display", + "type": "section", + "group": "Display" + }, + { + "key": "abr", + "label": "Backlight Timeout", + "type": "select", + "options": [ + "Off", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "mdfa", + "label": "Display Mode (A)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "mdfb", + "label": "Display Mode (B)", + "type": "select", + "options": [ + "Channel", + "Name", + "Frequency" + ] + }, + { + "key": "displayab", + "label": "Display Side", + "type": "select", + "options": [ + "A", + "B" + ] + }, + { + "key": "wtled", + "label": "Standby LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "rxled", + "label": "RX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "txled", + "label": "TX LED Color", + "type": "select", + "options": [ + "Off", + "Blue", + "Orange", + "Purple" + ] + }, + { + "key": "poweron_msg.line1", + "label": "Power-On Message Line 1", + "type": "text", + "max_length": 7 + }, + { + "key": "poweron_msg.line2", + "label": "Power-On Message Line 2", + "type": "text", + "max_length": 7 + }, + { + "key": "section-sounds", + "label": "Sounds", + "type": "section", + "group": "Sounds" + }, + { + "key": "beep", + "label": "Key Beep", + "type": "boolean" + }, + { + "key": "roger", + "label": "Roger Beep", + "type": "boolean" + }, + { + "key": "voice", + "label": "Voice Prompt", + "type": "select", + "options": [ + "Off", + "English", + "Chinese" + ] + }, + { + "key": "section-transmit-and-receive", + "label": "Transmit & Receive", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "squelch", + "label": "Carrier Squelch Level", + "type": "integer", + "min": 0, + "max": 9 + }, + { + "key": "timeout", + "label": "Timeout Timer", + "type": "select", + "options": [ + "15 sec", + "30 sec", + "45 sec", + "60 sec", + "75 sec", + "90 sec", + "105 sec", + "120 sec", + "135 sec", + "150 sec", + "165 sec", + "180 sec", + "195 sec", + "210 sec", + "225 sec", + "240 sec", + "255 sec", + "270 sec", + "285 sec", + "300 sec", + "315 sec", + "330 sec", + "345 sec", + "360 sec", + "375 sec", + "390 sec", + "405 sec", + "420 sec", + "435 sec", + "450 sec", + "465 sec", + "480 sec", + "495 sec", + "510 sec", + "525 sec", + "540 sec", + "555 sec", + "570 sec", + "585 sec", + "600 sec" + ] + }, + { + "key": "vox", + "label": "VOX Sensitivity", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "tdr", + "label": "Dual Watch", + "type": "boolean" + }, + { + "key": "tdrab", + "label": "Dual Watch TX Priority", + "type": "select", + "options": [ + "Off", + "A", + "B" + ] + }, + { + "key": "ste", + "label": "Squelch Tail Eliminate (HT to HT)", + "type": "boolean" + }, + { + "key": "rpste", + "label": "Squelch Tail Eliminate (repeater)", + "type": "select", + "options": [ + "OFF", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10" + ] + }, + { + "key": "rptrl", + "label": "STE Repeater Delay", + "type": "select", + "options": [ + "OFF", + "100 ms", + "200 ms", + "300 ms", + "400 ms", + "500 ms", + "600 ms", + "700 ms", + "800 ms", + "900 ms", + "1000 ms" + ] + }, + { + "key": "section-band-limits", + "label": "Band Limits", + "type": "section", + "group": "Transmit & Receive" + }, + { + "key": "limits.vhf.lower", + "label": "VHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf.upper", + "label": "VHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf2.lower", + "label": "220 Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.vhf2.upper", + "label": "220 Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.lower", + "label": "UHF Lower Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "limits.uhf.upper", + "label": "UHF Upper Limit (MHz)", + "type": "integer", + "min": 1, + "max": 1000 + }, + { + "key": "section-memory-and-vfo", + "label": "Memory & VFO", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "workmode", + "label": "VFO/MR Mode", + "type": "select", + "options": [ + "Frequency", + "Channel" + ] + }, + { + "key": "wmchannel.mrcha", + "label": "MR A Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "wmchannel.mrchb", + "label": "MR B Channel", + "type": "integer", + "min": 0, + "max": 127 + }, + { + "key": "section-vfo", + "label": "VFO A / B", + "type": "section", + "group": "Memory & VFO" + }, + { + "key": "vfoa.freq", + "label": "VFO A Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.freq", + "label": "VFO B Frequency (MHz)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.sftd", + "label": "VFO A Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfob.sftd", + "label": "VFO B Shift", + "type": "select", + "options": [ + "Off", + "+", + "-" + ] + }, + { + "key": "vfoa.offset", + "label": "VFO A Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfob.offset", + "label": "VFO B Offset (0.0-999.999)", + "type": "text", + "max_length": 10 + }, + { + "key": "vfoa.txpower_hilo", + "label": "VFO A Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfob.txpower_hilo", + "label": "VFO B Power", + "type": "select", + "options": [ + "High", + "Low" + ] + }, + { + "key": "vfoa.widenarr", + "label": "VFO A Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfob.widenarr", + "label": "VFO B Bandwidth", + "type": "select", + "options": [ + "Wide", + "Narrow" + ] + }, + { + "key": "vfoa.scode", + "label": "VFO A PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfob.scode", + "label": "VFO B PTT-ID", + "type": "select", + "options": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15" + ] + }, + { + "key": "vfoa.step", + "label": "VFO A Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "vfob.step", + "label": "VFO B Tuning Step", + "type": "select", + "options": [ + "2.5", + "5.0", + "6.25", + "10.0", + "12.5", + "20.0", + "25.0", + "50.0" + ] + }, + { + "key": "section-scan", + "label": "Scan", + "type": "section", + "group": "Scan" + }, + { + "key": "screv", + "label": "Scan Resume", + "type": "select", + "options": [ + "TO", + "CO", + "SE" + ] + }, + { + "key": "section-dtmf", + "label": "DTMF & ANI", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "dtmfst", + "label": "DTMF Sidetone", + "type": "select", + "options": [ + "OFF", + "DT-ST", + "ANI-ST", + "DT+ANI" + ] + }, + { + "key": "pttid", + "label": "When to send PTT ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "ani.dtmfon", + "label": "DTMF Speed (on)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "ani.dtmfoff", + "label": "DTMF Speed (off)", + "type": "select", + "options": [ + "50 ms", + "60 ms", + "70 ms", + "80 ms", + "90 ms", + "100 ms", + "110 ms", + "120 ms", + "130 ms", + "140 ms", + "150 ms", + "160 ms", + "170 ms", + "180 ms", + "190 ms", + "200 ms", + "210 ms", + "220 ms", + "230 ms", + "240 ms", + "250 ms", + "260 ms", + "270 ms", + "280 ms", + "290 ms", + "300 ms", + "310 ms", + "320 ms", + "330 ms", + "340 ms", + "350 ms", + "360 ms", + "370 ms", + "380 ms", + "390 ms", + "400 ms", + "410 ms", + "420 ms", + "430 ms", + "440 ms", + "450 ms", + "460 ms", + "470 ms", + "480 ms", + "490 ms", + "500 ms", + "510 ms", + "520 ms", + "530 ms", + "540 ms", + "550 ms", + "560 ms", + "570 ms", + "580 ms", + "590 ms", + "600 ms", + "610 ms", + "620 ms", + "630 ms", + "640 ms", + "650 ms", + "660 ms", + "670 ms", + "680 ms", + "690 ms", + "700 ms", + "710 ms", + "720 ms", + "730 ms", + "740 ms", + "750 ms", + "760 ms", + "770 ms", + "780 ms", + "790 ms", + "800 ms", + "810 ms", + "820 ms", + "830 ms", + "840 ms", + "850 ms", + "860 ms", + "870 ms", + "880 ms", + "890 ms", + "900 ms", + "910 ms", + "920 ms", + "930 ms", + "940 ms", + "950 ms", + "960 ms", + "970 ms", + "980 ms", + "990 ms", + "1000 ms", + "1010 ms", + "1020 ms", + "1030 ms", + "1040 ms", + "1050 ms", + "1060 ms", + "1070 ms", + "1080 ms", + "1090 ms", + "1100 ms", + "1110 ms", + "1120 ms", + "1130 ms", + "1140 ms", + "1150 ms", + "1160 ms", + "1170 ms", + "1180 ms", + "1190 ms", + "1200 ms", + "1210 ms", + "1220 ms", + "1230 ms", + "1240 ms", + "1250 ms", + "1260 ms", + "1270 ms", + "1280 ms", + "1290 ms", + "1300 ms", + "1310 ms", + "1320 ms", + "1330 ms", + "1340 ms", + "1350 ms", + "1360 ms", + "1370 ms", + "1380 ms", + "1390 ms", + "1400 ms", + "1410 ms", + "1420 ms", + "1430 ms", + "1440 ms", + "1450 ms", + "1460 ms", + "1470 ms", + "1480 ms", + "1490 ms", + "1500 ms", + "1510 ms", + "1520 ms", + "1530 ms", + "1540 ms", + "1550 ms", + "1560 ms", + "1570 ms", + "1580 ms", + "1590 ms", + "1600 ms", + "1610 ms", + "1620 ms", + "1630 ms", + "1640 ms", + "1650 ms", + "1660 ms", + "1670 ms", + "1680 ms", + "1690 ms", + "1700 ms", + "1710 ms", + "1720 ms", + "1730 ms", + "1740 ms", + "1750 ms", + "1760 ms", + "1770 ms", + "1780 ms", + "1790 ms", + "1800 ms", + "1810 ms", + "1820 ms", + "1830 ms", + "1840 ms", + "1850 ms", + "1860 ms", + "1870 ms", + "1880 ms", + "1890 ms", + "1900 ms", + "1910 ms", + "1920 ms", + "1930 ms", + "1940 ms", + "1950 ms", + "1960 ms", + "1970 ms", + "1980 ms", + "1990 ms", + "2000 ms" + ] + }, + { + "key": "pttlt", + "label": "PTT ID Delay", + "type": "integer", + "min": 0, + "max": 50 + }, + { + "key": "ani.code", + "label": "ANI Code", + "type": "text", + "max_length": 5 + }, + { + "key": "ani.aniid", + "label": "ANI ID", + "type": "select", + "options": [ + "Off", + "BOT", + "EOT", + "Both" + ] + }, + { + "key": "section-ptt-id-codes", + "label": "PTT ID Codes", + "type": "section", + "group": "DTMF & Signaling" + }, + { + "key": "pttid/0.code", + "label": "PTT ID Code 1", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/1.code", + "label": "PTT ID Code 2", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/2.code", + "label": "PTT ID Code 3", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/3.code", + "label": "PTT ID Code 4", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/4.code", + "label": "PTT ID Code 5", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/5.code", + "label": "PTT ID Code 6", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/6.code", + "label": "PTT ID Code 7", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/7.code", + "label": "PTT ID Code 8", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/8.code", + "label": "PTT ID Code 9", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/9.code", + "label": "PTT ID Code 10", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/10.code", + "label": "PTT ID Code 11", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/11.code", + "label": "PTT ID Code 12", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/12.code", + "label": "PTT ID Code 13", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/13.code", + "label": "PTT ID Code 14", + "type": "text", + "max_length": 5 + }, + { + "key": "pttid/14.code", + "label": "PTT ID Code 15", + "type": "text", + "max_length": 5 + } +]