From 27b53a9d258c1571755135cc79532c50e6fbccf2 Mon Sep 17 00:00:00 2001 From: Andy Knitt Date: Sun, 16 Jul 2023 17:27:58 -0500 Subject: [PATCH] Add new class for radios with extended transmit modification (MARS/CAP) that uses a different ID_BLOCK value. --- chirp/drivers/ft2800.py | 21 ++++++++++++++++++--- tests/Python3_Driver_Testing.md | 7 ++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/chirp/drivers/ft2800.py b/chirp/drivers/ft2800.py index 07b3a4376..123bf9df6 100644 --- a/chirp/drivers/ft2800.py +++ b/chirp/drivers/ft2800.py @@ -33,7 +33,6 @@ def _send(s, data): raise Exception("Failed to read echo chunk") -IDBLOCK = b"\x0c\x01\x41\x33\x35\x02\x00\xb8" TRAILER = b"\x0c\x02\x41\x33\x35\x00\x00\xb7" ACK = b"\x0C\x06\x00" @@ -43,7 +42,8 @@ def _download(radio): attempts = 30 for _i in range(0, attempts): data = radio.pipe.read(8) - if data == IDBLOCK: + print(data) + if data == radio.IDBLOCK: break LOG.debug('Download attempt %i received %i: %s', _i, len(data), util.hexprint(data)) @@ -103,7 +103,7 @@ def _upload(radio): break LOG.debug("What is this garbage?\n%s" % util.hexprint(data)) - _send(radio.pipe, IDBLOCK) + _send(radio.pipe, radio.IDBLOCK) time.sleep(1) ack = radio.pipe.read(300) LOG.debug("Ack was (%i):\n%s" % (len(ack), util.hexprint(ack))) @@ -178,6 +178,7 @@ class FT2800Radio(YaesuCloneModeRadio): """Yaesu FT-2800""" VENDOR = "Yaesu" MODEL = "FT-2800M" + IDBLOCK = b"\x0c\x01\x41\x33\x35\x02\x00\xb8" _block_sizes = [8, 7680] _memsize = 7680 @@ -317,3 +318,17 @@ def set_memory(self, mem): @classmethod def match_model(cls, filedata, filename): return len(filedata) == cls._memsize + + +# This class is for the TX Modified FT-2800 (MARS/CAP Mod). +# Enabling out of band TX changes the header received by CHIRP +@directory.register +class FT2800ModRadio(FT2800Radio): + """Yaesu FT-2800Mod""" + MODEL = "FT-2800M(TXMod)" + VARIANT = "Opened Xmit" + IDBLOCK = b"\x0c\x01\x41\x33\x35\x03\x00\xb9" + + @classmethod + def match_model(cls, filedata, filename): + return False diff --git a/tests/Python3_Driver_Testing.md b/tests/Python3_Driver_Testing.md index 48ccd9b16..0cd5ef88d 100644 --- a/tests/Python3_Driver_Testing.md +++ b/tests/Python3_Driver_Testing.md @@ -372,6 +372,7 @@ | Yaesu_FT-1D_R | [Implied by Yaesu_FT3D_R](#user-content-Yaesu_FT3D_R) | 30-Dec-2022 | Yes | 0.03% | | Yaesu_FT-25R | [Implied by Yaesu_FT-4XE](#user-content-Yaesu_FT-4XE) | 24-Dec-2022 | Yes | 0.01% | | Yaesu_FT-2800M | [Reported working](https://chirp.danplanet.com/issues/10616) | 05-Jun-2023 | Yes | 0.03% | +| Yaesu_FT-2800MTXMod_Opened_Xmit | | | Yes | | | Yaesu_FT-2900R_1900R | [Reported working](https://chirp.danplanet.com/issues/10274) | 14-Jan-2023 | Yes | 0.05% | | Yaesu_FT-2900R_1900RTXMod_Opened_Xmit | [Implied by Yaesu_FT-2900R_1900R](#user-content-Yaesu_FT-2900R_1900R) | 14-Jan-2023 | Yes | | | Yaesu_FT-450D | [@Old-Phart](https://github.com/Old-Phart) | 01-Jun-2023 | Yes | 0.01% | @@ -415,11 +416,11 @@ | Zastone_ZT-X6 | [Implied by Retevis_RT22](#user-content-Retevis_RT22) | 9-Dec-2022 | Yes | 0.11% | ## Stats -**Drivers:** 412 +**Drivers:** 413 -**Tested:** 86% (357/55) (93% of usage stats) +**Tested:** 86% (357/56) (93% of usage stats) -**Byte clean:** 90% (372/40) +**Byte clean:** 90% (373/40) ## Meaning of this testing