Commit graph

955 commits

Author SHA1 Message Date
Neil McNeight
a883164ead Second half of BCD work on kenwood_tone functions.
With this commit, the _set_tone_val() function now properly creates
binary-coded decimal (BCD) numbers, depending on how dcs_enc_base and
tone_enc_base are set when constructing a tone model.

The test cases were expanded to cover all permutations of valid values
for dcs_enc_base (8, 10, and 16) and tone_enc_base (10 and 16). All of
these test cases allow testing new inputs and outputs, as well as
validating that the new settings do not interfere with parsing when it
is not expected to.
2026-08-01 21:53:43 -07:00
Neil McNeight
b11249c348 First half of BCD work on kenwood_tone functions.
As part of the 5RH driver work, it was suggested to look at using the
kenwood_tone functions as the data appeared to be similar. A closer
look showed that they were similar, but not enough to be functional.

The existing Kenwood function puts the tone frequency * 10 into a 16-bit
integer, such that 100.0 Hz becomes 1000 which becomes 0x03E8.

For the 5RH, the tone frequency * 10 is stored as a BCD (which is
effectively hexadecimal with six digits ignored). In this case, 100.0 Hz
becomes 1000 which becomes 0x1000.

In the process of testing the code, I modified the h777 driver to use it,
and discovered that those radios also stored the DCS code as BCD. Meaning
that a DCS code of 031, which would be stored as 0x0019 in octal or 0x001F
in decimal, would instead be stored as 0x0031.

The addition of the tone_enc_base variable for processing tone frequencies
as BCD, and the ability to set dcs_enc_base to 16 (effectively processing
as BCD), should widen the pool of potential users for this function, and
cut down on the number of separate tone implemenations and their tests.

With Dan's suggestion, this PR has been split into two parts: implementing
the first half (decoding with _get_tone_val()) to test against existing
code for encoding. The next commit will then implement the encoding half.

All test cases were duplicated using two tone models; model_dec with
dcs_enc_base defaulted to 8 and tone_enc_base defaulted to 10, and
model_bcd with dcs_enc_base and tone_enc_base both set to 16.
Both models allow testing new inputs and outputs, as well as validating
that the new settings do not interfere with parsing when it is not
expected to.
2026-08-01 21:53:43 -07:00
Jan Szumiec
c2e70ff410 Add QYT KT-8900 setting documentation 2026-07-24 15:29:57 -07:00
TrimbleSoftware
79ce906385 Add test image for Bajeton BJ7800 2026-06-10 15:42:23 -07:00
TrimbleSoftware
a88e840909 Update RT-920 test image for FM,AM & HF memories 2026-06-10 15:42:23 -07:00
Dan Smith
82c6f4c313 Add BLE serial detection
This lets us determine if a device we are about to use for
communicating with a radio appears to be a ble-serial virtual port.
2026-05-20 14:47:03 -07:00
davejbuilds
8064dfc421 mp31: Add support for Baofeng MP31
Adds MP31Radio as a subclass of H777Radio. Overrides memory format
for 38 channels at 0x0000, settings2 at 0x026B, and memsize capped
at 0x0400 (radio silent above this address). Alias for Pxton 999S
added to model_alias_map.yaml. Tested on live hardware with CH340
cable on macOS.

Fixes #11505

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 15:51:21 -07:00
Darius Rad
2849e211fb Don't complain about incompatible tones on import if no tone mode selected
Fixes #12477
2026-05-07 16:58:11 -07:00
Benjamin Evans Chodroff
1ff876306e ic2730: Add IC-2730E (European variant) support
The IC-2730E speaks the initial clone handshake at 19200 baud (not
9600 like the IC-2730A) and only responds to the CLONE_ID query
when the payload contains the radio's own model code with the last
byte zeroed, instead of the all-zeros payload sent by every other
Icom clone-mode driver. It also returns "Icom Inc.4D" as the
end-of-clone frame instead of ".4E".

Add a thin IC2730ERadio subclass with these three overrides,
leaving the existing IC-2730A driver untouched (no A variant
hardware available for testing). Behavior is gated by a new
opt-in flag _id_query_with_model on IcomCloneModeRadio with a
default of False, so the 25 other Icom clone-mode drivers are
unchanged. icf.IcomCloneModeRadio.sync_out now reads self.BAUD_RATE
instead of hardcoding 9600; this is a no-op for every existing
clone-mode driver (24 inherit the 9600 default; IcomM710Radio
overrides sync_out itself).

Diagnosed by capturing the Icom CS-2730 protocol exchange under
Parallels and isolating each variable; the radio responds only
when both baud=19200 AND the query payload contains the model
code.

Tested with a real IC-2730E: full clone-from-radio (21312 bytes)
and clone-to-radio both succeed.

Fixes #12481

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 16:59:16 -07:00
Scott Walde
31aba34b2e vx150: Add driver for Vertex Standard VX-150 2026-04-18 13:35:43 -07:00
David James McCorrie
56755d536d TK7162: add initial support
Signed-off-by: David James McCorrie <djmccorrie@gmail.com>
2026-04-17 15:43:21 -07:00
Mel Terechenok
d5b926e5a1 Add Wouxun XS20 series channel memory support
Fixes #12014
Fixes #11289

Add Channel Memory support for Wouxun XS20G, XS20G Plus and XS20H
Simplify power selections

XS20 clean up

Only include changed items in subclasses - eliminate unnecessary VENDOR and _model line

XS20 update

Put Vendor back in for convention on subclasses

fix power setting logic for XS20 and 935 series

minimize _set_power code based on PR comments
2026-04-15 16:01:51 -07:00
Gordon Young
c15fdb749f baofeng_digital: Add BF-V12D support
Add the Baofeng BF-V12D as a new model in the baofeng_digital driver.
The V12D requires a ucbfpwd unlock sequence before entering programming
mode, implemented via a custom _get_radio_id() override.

Fixes: #12439
2026-04-15 15:32:00 -07:00
Dan Smith
f5d57bd578 Improve cache performance for RepeaterBook queries
Fixes:
 - Store and use ETag to prevent pulling unchanged data sets
 - Return our cache if we get a failure from the server, if present
 - Return our cache if we are unable to contact the server at all
2026-04-14 16:45:17 -07:00
Dan Smith
dbebb1bcf7 Add common KenwoodToneModel 2026-04-02 14:43:18 -07:00
Tony Gies
4f2aab8f6a baofeng_uv17Pro: Add Baofeng UV-5RM Plus. Fixes #12129 2026-04-01 05:28:24 -07:00
Tony Gies
915cdc7410 retevis_c2: Add Retevis C2 driver. Fixes #12421 2026-03-24 09:13:31 -07:00
Tony Gies
7e56fa2a2b radtel_rt900: Add Radioddity GS-10B
Add support for the Radioddity GS-10B, an RT-900 BT variant with
256 channels. Same magic string, fingerprints, and protocol as the
RT-900 BT but with a reduced channel count. Confirmed on firmware
V0.03 with 512- and 999-channel modes tested and verified as
unsupported by the hardware.
2026-03-24 08:30:36 -07:00
Dan Smith
bf24ade388 Centralize common checksum methods
A lot of drivers were reimplementing a couple of common checksum
routines. This puts them in a central place (along with the recent
CRC16 centralization, renaming crc to checksum).
2026-03-20 17:42:07 -07:00
Dan Smith
bd2f8d0578 Add missed TD-H8-G3 test image 2026-03-20 16:01:19 -07:00
Dan Smith
8b6366e0e4 Fix drivers modifying memory during set_memory()
This has been a warning for a while, so most of the popular drivers
are fixed by now. This fixes the two remaining (obvious) ones and adds
a test to prevent more from being added.

Note that there may be some that still only modify the memory in
edge cases that this test doesn't cover.
2026-03-17 15:27:37 -07:00
Dan Smith
59f2673c65 Protect validate_memory() calls with FrozenMemory
Some drivers were modifying the memory in validate_memory() to
side-step the rest of the UI validations. This removes that behavior
from those drivers and also passes FrozenMemory to validate_memory()
in strict mode to prevent this from creeping back in again.
2026-03-17 15:27:37 -07:00
Tony Gies
d3dccf93ee radioddity_db40g: Add Radioddity DB40-G driver
New standalone driver for the Radioddity DB40-G GMRS mobile radio.
40W UHF, 199 channels, 8-character names, 3 power levels (5/20/40W),
50 CTCSS + 104 DCS tones, 400-480 MHz RX.

Protocol: SMP558 family with page-based addressing (0x10 stride,
32-byte pages), 19200 baud. Read responses echo R prefix (not W
as in the T18 family). No ACK after reads. Frequencies stored as
big-endian 32-bit Hz (not BCD). Tones stored as big-endian 16-bit
with CTCSS as Hz*10 and DCS as 0x2800+code (normal) or
0xA800+code (inverted).

Settings: Busy Lock, Key Tone, TX Timeout, Squelch Level.

GMRS enforcement uses ValidationWarning (not immutable fields)
since the radio accepts writes to all channels including the
30 fixed GMRS channels. Firmware enforces TX restrictions by
frequency, not channel number.

Fixes #11341
2026-03-16 15:52:35 -07:00
Tommy83033
5feb1872ed Add support for Retevis HA2 model
Fixes #12345
2026-03-16 15:47:35 -07:00
Sage Grigull
2a3dbd0641 feat: Add Radio Amateur Satellites query source, integrate it into the UI. 2026-03-15 17:33:54 -07:00
Dan Smith
2cd274dae9 repeaterbook: Move to cached/proxied service
This moves CHIRP to use a proxy for repeaterbook at chirpmyradio.com
to reduce load on the repeaterbook API and improve performance for
our users.

Also, don't run the network tests in CI as they're less important
now and also their failing probably has nothing to do with the patch
being submitted.
2026-03-15 16:46:19 -07:00
Tony Gies
dc94198394 baofeng_uv17Pro: Add Baofeng UV-28Plus
Add driver for the Baofeng UV-28Plus, a tri-band (VHF/220/UHF) radio
with GPS, Bluetooth, AM airband receive, and three power levels
(10W/5W/2W). Subclasses UV17ProGPS with UV21ProV2 band plan.

Fixes #12085
2026-03-14 06:11:31 -07:00
Matthew Schmidt
60f3edae35 Fixes #12055 - Radtel RT880G 2026-03-03 15:39:09 -08:00
Dan Smith
bc56ae93ab Fix from_*Hz() helpers
These have been long broken and noted as such in the tests but were
never fixed.

The icq7 driver was dependent on this broken behavior in from_GHz(),
so change that driver to do the math it was expecting.
2026-02-25 18:26:40 -08:00
Jim Unroe
ba77073722 retevis_h777v4.py: add Retevis RT21H - fixes #12396 2026-02-25 17:07:36 -08:00
TrimbleSoftware
1467519e79 Add TD-M11 test .img files 2026-02-19 15:42:21 -08:00
Tony Gies
abe87c9fec Add Baofeng GM-21 and Radioddity GM-30 Pro
This adds support for two GMRS-only UV-17ProGPS variants.

GM-30 Pro is like GM-30 Plus but -GPS, +Bluetooth, and for whatever
reason also adds the "scramble" setting to the menu (same per-channel
setting as K6). Baofeng GM-21 is the same without scramble.

Found bluetooth enable in unknown5[0]; added _has_bt flag and setting.
Refactored scramble from BFK6-specific to _has_scramble flag. Extracted
GMRS implied modes variant logic from GM-30 Plus into intermediate
class. Removed vestigial MODEL_ID in RadioddityGM30Plus.

Fixes #11266
Fixes #11805
2026-02-14 08:31:22 -08:00
Tony Gies
77a0299172 Add Radioddity GM-30 Plus driver
Fixes #11568
2026-01-22 15:01:49 -08:00
Dan Smith
2262e2963c Improve "frequency out of range" message
This includes a concise summary of the ranges being tested when a
"frequency is out of range" error is raised.
2026-01-21 16:08:07 -08:00
Dan Smith
a98aca98ea Improve timeout sanity checks
This makes the timeout sanity checking also consider a large write
before a read in determining how much time must be available for the
data to flush in and out.
2026-01-17 16:34:08 -08:00
Dan Smith
3f8c574b9f btech: Remove bespoke buffer discard routine
This makes us use pyserial's own input flushing routine.
2026-01-17 14:27:14 -08:00
Dan Smith
1581ba898d Warn about insanely low serial timeouts
Some drivers try to read more data in a single call than could
possibly fit within the timeout. Thus, unless the radio is ahead of
us, we'll definitely timeout before having read everything. This
makes our SerialTrace calculate our bytes-per-second and complain if
we try to read more than we could possibly receive in that time. This
will likely false-positive on some drivers that do their own serial
line flushing, but we should fix those anyway.
2026-01-15 15:18:03 -08:00
Tony Gies
e6100c8a3d radioddity_gm30: Add Radioddity MU-5 subclass
The MU-5 is essentially a GM-30 configured for MURS service:
- Channels 1-20: Fixed to MURS frequencies (151.82, 151.88,
  151.94, 154.57, 154.60 MHz repeating). Freq stored in EEPROM
  is ignored; radio firmware enforces the correct frequency.
- Channels 21-250: User-programmable RX-only (scanlist entries)
- Power: Fixed to Low for channels 1-20
- Mode: Narrowband (NFM) enforced on MURS channels 1-3, 6-8,
  11-13, 16-18
2026-01-12 14:44:03 -08:00
Aaron Snyder
6582f7879e anytone779: support sql_mode when setting
This commit ensures that when setting an RX tone of any kind,
the radio will only play audio that has a matching tone.

Without this commit, the radio will play any audio that breaks
squelch vs audio that has the matching tone.

On the radio this maps to the 5:signal setting in the function
menu.

Tested on an Anytone779. Should also be the same for Retivis RA25
and Radioddity DB-20G
2026-01-10 06:00:21 -08:00
Jim Unroe
d019c446b9 retevis_rt21: support Retevis RB626 settings - fixes #11832 2026-01-08 14:46:44 -08:00
Dan Smith
8067972ca2 More fixing 8.33kHz frequency and channel handling
Man, what a mess 8.33 aircraft band is. This makes us able to support
the pseudo-frequency channel "names" that Eurocontrol thought were
a good idea.

Related to #12316
2026-01-07 17:27:10 -08:00
Don Barber
a5252de541 Add VX1R driver
Fixes #2371
2026-01-02 14:36:09 -08:00
TrimbleSoftware
412685c82e uv17Pro: Add new model UV-5G Mini.
Supports Fw v0.05 and Fw v0.01
Fixes #12277
2025-12-30 14:22:19 -08:00
Dan Smith
2d4950134e Fix test_clone to distinguish clone in/out
This makes it easier to debug which side of the test case is failing.
2025-12-18 08:14:40 -08:00
Dan Smith
a6a4e3abd7 Refactor common CRC module
This attempts to kinda sorta make us use the same CRC16 implementation
for both of the two current modes in use in the tree.
2025-12-01 16:55:01 -08:00
Dan Smith
25ef06015a Move CRC out of ha1g to a common module
This is a straight move, with unit tests to verify behavior before
refactor.
2025-12-01 16:55:01 -08:00
ThibBer
bf9589b61d Add driver for Quansheng TK11
Fixes #12017
2025-12-01 15:14:42 -08:00
Dan Smith
a3b973cceb Remove Vertex Standard radio drivers
These drivers are known to be problematic in general, but also have
not been converted for use in chirp-next. This removes these from the
tree as there is no plan to modernize or fix them at this time. Also,
Vertex and Yaesu radios are very fragile (as Vertex/Yaesu has stated)
and so removing support for them is probably best anyway. The Yaesu
drivers are, at least, widely used but these Vertex ones are clearly
not. So, this also reduces/removes potential problems.

If someone comes back to fix them in the future, they can be added
back. Since they're only usable in/by chirp-legacy there's really no
need to keep them alive in the main tree. Note that this will remove
them from the supported radios list.

Related to #11319
Related to #679
Related to #677
Related to #605
Related to #7599
Related to #9499
2025-10-30 15:43:05 -07:00
Jim Unroe
8116c3782a th9800.py: Add Retevis_MA1 - fixes #11943 2025-10-23 14:48:54 -07:00
Tommy83033
bf1f976e02 Added Retevis HA1G and HA1UV models
1. Channel Module
2. Basic Settings
3. DTMF Settings
4. Scan List Settings
5. VFO Scan Settings
6. Alarm List Settings

Added Retevis HA1G.img and Retevis HA1UV.img in tests/images
2025-10-20 15:31:29 -07:00