Skip to content

Commit

Permalink
Add new class for radios with extended transmit modification (MARS/CA…
Browse files Browse the repository at this point in the history
…P) that uses a different ID_BLOCK value.
  • Loading branch information
aaknitt committed Jul 17, 2023
1 parent e5a4292 commit 27b53a9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
21 changes: 18 additions & 3 deletions chirp/drivers/ft2800.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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))
Expand Down Expand Up @@ -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)))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
7 changes: 4 additions & 3 deletions tests/Python3_Driver_Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@
| <a name="Yaesu_FT-1D_R"></a> Yaesu_FT-1D_R | [Implied by Yaesu_FT3D_R](#user-content-Yaesu_FT3D_R) | 30-Dec-2022 | Yes | 0.03% |
| <a name="Yaesu_FT-25R"></a> Yaesu_FT-25R | [Implied by Yaesu_FT-4XE](#user-content-Yaesu_FT-4XE) | 24-Dec-2022 | Yes | 0.01% |
| <a name="Yaesu_FT-2800M"></a> Yaesu_FT-2800M | [Reported working](https://chirp.danplanet.com/issues/10616) | 05-Jun-2023 | Yes | 0.03% |
| <a name="Yaesu_FT-2800MTXMod_Opened_Xmit"></a> Yaesu_FT-2800MTXMod_Opened_Xmit | | | Yes | |
| <a name="Yaesu_FT-2900R_1900R"></a> Yaesu_FT-2900R_1900R | [Reported working](https://chirp.danplanet.com/issues/10274) | 14-Jan-2023 | Yes | 0.05% |
| <a name="Yaesu_FT-2900R_1900RTXMod_Opened_Xmit"></a> Yaesu_FT-2900R_1900RTXMod_Opened_Xmit | [Implied by Yaesu_FT-2900R_1900R](#user-content-Yaesu_FT-2900R_1900R) | 14-Jan-2023 | Yes | |
| <a name="Yaesu_FT-450D"></a> Yaesu_FT-450D | [@Old-Phart](https://github.com/Old-Phart) | 01-Jun-2023 | Yes | 0.01% |
Expand Down Expand Up @@ -415,11 +416,11 @@
| <a name="Zastone_ZT-X6"></a> 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

Expand Down

0 comments on commit 27b53a9

Please sign in to comment.