Add Alinco DJ-G7T

Fixes #6801
This commit is contained in:
Dan Smith 2023-01-12 20:47:18 -08:00 committed by Dan Smith
parent 1db6922e03
commit 0e75963d15
4 changed files with 24 additions and 10 deletions

View File

@ -554,7 +554,7 @@ class DJ175Radio(DRx35Radio):
return data
DJG7EG_MEM_FORMAT = """
DJG7_MEM_FORMAT = """
#seekto 0x200;
ul16 bank[50];
ul16 special_bank[7];
@ -580,8 +580,7 @@ struct {
"""
@directory.register
class AlincoDJG7EG(AlincoStyleRadio):
class AlincoDJG7(AlincoStyleRadio):
"""Alinco DJ-G7EG"""
VENDOR = "Alinco"
MODEL = "DJ-G7EG"
@ -595,7 +594,6 @@ class AlincoDJG7EG(AlincoStyleRadio):
TMODES = ["", "??1", "Tone", "TSQL", "TSQL-R", "DTCS"]
# This is a bit of a hack to avoid overwriting _identify()
_model = b"AL~DJ-G7EG"
_memsize = 0x1a7c0
_range = [(500000, 1300000000)]
@ -757,7 +755,7 @@ class AlincoDJG7EG(AlincoStyleRadio):
"frequency. Touch channel to fix." % number)
def process_mmap(self):
self._memobj = bitwise.parse(DJG7EG_MEM_FORMAT, self._mmap)
self._memobj = bitwise.parse(DJG7_MEM_FORMAT, self._mmap)
# We check all channels for corruption (see bug #5275) but we don't fix
# it automatically because it would be unpolite to modify something on
# a read operation. A log message is emitted though for the user to
@ -846,3 +844,17 @@ class AlincoDJG7EG(AlincoStyleRadio):
_mem.unknown2 = 0x0000000a
_mem.unknown3 = 0x00000000
_mem.unknown4 = 0x00000000
@directory.register
class AlincoDJG7EG(AlincoDJG7):
"""Alinco DJ-G7EG"""
MODEL = "DJ-G7EG"
_model = b"AL~DJ-G7EG"
@directory.register
class AlincoDJG7T(AlincoDJG7):
"""Alinco DJ-G7T"""
MODEL = "DJ-G7T"
_model = b"AL~DJ-G7T"

View File

@ -5,6 +5,7 @@
| <a name="Abbree_AR-518"></a> Abbree_AR-518 | [@KC9HI](https://github.com/KC9HI) | 16-Dec-2022 | Yes | 0.24% |
| <a name="Abbree_AR-63"></a> Abbree_AR-63 | [@KC9HI](https://github.com/KC9HI) | 30-Nov-2022 | Yes | 0.03% |
| <a name="Alinco_DJ-G7EG"></a> Alinco_DJ-G7EG | [@HB9UF](https://github.com/HB9UF) | 09-Dec-2022 | Yes | 0.44% |
| <a name="Alinco_DJ-G7T"></a> Alinco_DJ-G7T | | | Yes | |
| <a name="Alinco_DJ175"></a> Alinco_DJ175 | [Implied by Alinco_DR235T](#user-content-Alinco_DR235T) | 12-Dec-2022 | Yes | 0.03% |
| <a name="Alinco_DJ596"></a> Alinco_DJ596 | [Implied by Alinco_DR235T](#user-content-Alinco_DR235T) | 12-Dec-2022 | Yes | 0.02% |
| <a name="Alinco_DR03T"></a> Alinco_DR03T | [Implied by Alinco_DR235T](#user-content-Alinco_DR235T) | 12-Dec-2022 | Yes | 0.01% |
@ -362,11 +363,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:** 359
**Drivers:** 360
**Tested:** 80% (290/69) (92% of usage stats)
**Tested:** 80% (290/70) (92% of usage stats)
**Byte clean:** 87% (314/45)
**Byte clean:** 87% (315/45)
## Meaning of this testing

Binary file not shown.

View File

@ -78,7 +78,7 @@ class FakeAlincoSerial:
if data.startswith(b'DR'):
self.ident = data.strip()
self.readbuf.append(ident_ack)
elif data.startswith(b'AL~DJ-G7EG'):
elif data.startswith(b'AL~DJ-G7'):
self.ident = data.strip()
self.readbuf.append(ident_ack)
elif data.startswith(b'DJ'):
@ -115,7 +115,8 @@ class AlincoCloneTest(unittest.TestCase):
radio.pipe = pipe
radio.sync_out()
ref_image = open(image, 'rb').read()
self.assertEqual(ref_image[0x200:], pipe.image.get_packed()[0x200:])
self.assertEqual(ref_image[0x200:rclass._memsize],
pipe.image.get_packed()[0x200:rclass._memsize])
def _test_alinco(self, rclass):
ident = directory.radio_class_id(rclass)