Project

General

Profile

New Model #10816 » radioddity_r2_rt24v.py

test to add RT24V (VHF: 136-174 MHz) - Jim Unroe, 08/27/2023 11:13 AM

 
1
# Copyright August 2018 Klaus Ruebsam <dg5eau@ruebsam.eu>
2
#
3
# This program is free software: you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation, either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15

    
16
import time
17
import struct
18
import logging
19

    
20
from chirp import chirp_common, directory, memmap
21
from chirp import bitwise, errors, util
22
from chirp.settings import RadioSetting, RadioSettingGroup, \
23
    RadioSettingValueInteger, RadioSettingValueList, \
24
    RadioSettingValueBoolean, RadioSettings
25

    
26
LOG = logging.getLogger(__name__)
27

    
28
# memory map
29
# 0000 copy of channel 16: 0100 - 010F
30
# 0010 Channel 1
31
# 0020 Channel 2
32
# 0030 Channel 3
33
# 0040 Channel 4
34
# 0050 Channel 5
35
# 0060 Channel 6
36
# 0070 Channel 7
37
# 0080 Channel 8
38
# 0090 Channel 9
39
# 00A0 Channel 10
40
# 00B0 Channel 11
41
# 00C0 Channel 12
42
# 00D0 Channel 13
43
# 00E0 Channel 14
44
# 00F0 Channel 15
45
# 0100 Channel 16
46
# 03C0 various settings
47

    
48
# the last three bytes of every channel are identical
49
# to the first three bytes of the next channel in row.
50
# However it will automatically be filled by the radio itself
51

    
52
MEM_FORMAT = """
53
#seekto 0x0010;
54
struct {
55
  lbcd rx_freq[4];
56
  lbcd tx_freq[4];
57
  lbcd rx_tone[2];
58
  lbcd tx_tone[2];
59
  u8 unknown1:1,
60
    compand:1,
61
    scramb:1,
62
    scanadd:1,
63
    power:1,
64
    mode:1,
65
    unknown2:1,
66
    bclo:1;
67
  u8 reserved[3];
68
} memory[16];
69

    
70
#seekto 0x03C0;
71
struct {
72
  u8 unknown3c08:1,
73
      scanmode:1,
74
      unknown3c06:1,
75
      unknown3c05:1,
76
      voice:2,
77
      save:1,
78
      beep:1;
79
  u8 squelch;
80
  u8 unknown3c2;
81
  u8 timeout;
82
  u8 voxgain;
83
  u8 specialcode;
84
  u8 unknown3c6;
85
  u8 voxdelay;
86
} settings;
87

    
88
"""
89

    
90
CMD_ACK = b"\x06"
91
CMD_ALT_ACK = b"\x53"
92
CMD_STX = b"\x02"
93
CMD_ENQ = b"\x05"
94

    
95
POWER_LEVELS = [chirp_common.PowerLevel("Low",  watts=0.50),
96
                chirp_common.PowerLevel("High", watts=3.00)]
97
TIMEOUT_LIST = ["Off"] + ["%s seconds" % x for x in range(30, 330, 30)]
98
SCANMODE_LIST = ["Carrier", "Timer"]
99
VOICE_LIST = ["Off", "Chinese", "English"]
100
VOX_LIST = ["Off"] + ["%s" % x for x in range(1, 9)]
101
VOXDELAY_LIST = ["0.5", "1.0", "1.5", "2.0", "2.5", "3.0"]
102
MODE_LIST = ["FM", "NFM"]
103

    
104
TONES = chirp_common.TONES
105
DTCS_CODES = chirp_common.DTCS_CODES
106

    
107
FRS16_FREQS = [462562500, 462587500, 462612500, 462637500,
108
               462662500, 462625000, 462725000, 462687500,
109
               462712500, 462550000, 462575000, 462600000,
110
               462650000, 462675000, 462700000, 462725000]
111

    
112
PMR_FREQS1 = [446006250, 446018750, 446031250, 446043750, 446056250,
113
              446068750, 446081250, 446093750]
114
PMR_FREQS2 = [446106250, 446118750, 446131250, 446143750, 446156250,
115
              446168750, 446181250, 446193750]
116

    
117
PMR_FREQS = PMR_FREQS1 + PMR_FREQS2
118

    
119
VALID_CHARS = chirp_common.CHARSET_ALPHANUMERIC + \
120
    "`{|}!\"#$%&'()*+,-./:;<=>?@[]^_"
121

    
122

    
123
def _r2_enter_programming_mode(radio):
124
    serial = radio.pipe
125

    
126
    magic = b"TYOGRAM"
127
    exito = False
128
    serial.write(CMD_STX)
129
    for i in range(0, 5):
130
        for j in range(0, len(magic)):
131
            serial.write(magic[j:j + 1])
132
        ack = serial.read(1)
133
        if ack == CMD_ACK:
134
            exito = True
135
            break
136

    
137
    # check if we had EXITO
138
    if exito is False:
139
        msg = "The radio did not accept program mode after five tries.\n"
140
        msg += "Check your interface cable and power cycle your radio."
141
        raise errors.RadioError(msg)
142

    
143
    try:
144
        serial.write(CMD_STX)
145
        ident = serial.read(8)
146
    except:
147
        _r2_exit_programming_mode(radio)
148
        raise errors.RadioError("Error communicating with radio")
149

    
150
    # No idea yet what the next 7 bytes stand for
151
    # as long as they start with ACK (or ALT_ACK on some devices) we are fine
152
    if not ident.startswith(CMD_ACK) and not ident.startswith(CMD_ALT_ACK):
153
        _r2_exit_programming_mode(radio)
154
        LOG.debug(util.hexprint(ident))
155
        raise errors.RadioError("Radio returned unknown identification string")
156

    
157
    try:
158
        serial.write(CMD_ACK)
159
        ack = serial.read(1)
160
    except:
161
        _r2_exit_programming_mode(radio)
162
        raise errors.RadioError("Error communicating with radio")
163

    
164
    if ack != CMD_ACK:
165
        _r2_exit_programming_mode(radio)
166
        raise errors.RadioError("Radio refused to enter programming mode")
167

    
168
    # the next 6 bytes represent the 6 digit password
169
    # they are somehow coded where '1' becomes x01 and 'a' becomes x25
170
    try:
171
        serial.write(CMD_ENQ)
172
        ack = serial.read(6)
173
    except:
174
        _r2_exit_programming_mode(radio)
175
        raise errors.RadioError("Error communicating with radio")
176

    
177
    # we will only read if no password is set
178
    if ack != b"\xFF\xFF\xFF\xFF\xFF\xFF":
179
        _r2_exit_programming_mode(radio)
180
        raise errors.RadioError("Radio is password protected")
181
    try:
182
        serial.write(CMD_ACK)
183
        ack = serial.read(6)
184

    
185
    except:
186
        _r2_exit_programming_mode(radio)
187
        raise errors.RadioError("Error communicating with radio 2")
188

    
189
    if ack != CMD_ACK:
190
        _r2_exit_programming_mode(radio)
191
        raise errors.RadioError("Radio refused to enter programming mode 2")
192

    
193

    
194
def _r2_exit_programming_mode(radio):
195
    serial = radio.pipe
196
    try:
197
        serial.write(CMD_ACK)
198
    except:
199
        raise errors.RadioError("Radio refused to exit programming mode")
200

    
201

    
202
def _r2_read_block(radio, block_addr, block_size):
203
    serial = radio.pipe
204

    
205
    cmd = struct.pack(">cHb", b'R', block_addr, block_size)
206
    expectedresponse = b"W" + cmd[1:]
207
    LOG.debug("Reading block %04x..." % (block_addr))
208

    
209
    try:
210
        for j in range(0, len(cmd)):
211
            time.sleep(0.005)
212
            serial.write(cmd[j:j + 1])
213

    
214
        response = serial.read(4 + block_size)
215
        if response[:4] != expectedresponse:
216
            _r2_exit_programming_mode(radio)
217
            raise Exception("Error reading block %04x." % (block_addr))
218

    
219
        block_data = response[4:]
220

    
221
        time.sleep(0.005)
222
        serial.write(CMD_ACK)
223
        ack = serial.read(1)
224
    except:
225
        _r2_exit_programming_mode(radio)
226
        raise errors.RadioError("Failed to read block at %04x" % block_addr)
227

    
228
    if ack != CMD_ACK:
229
        _r2_exit_programming_mode(radio)
230
        raise Exception("No ACK reading block %04x." % (block_addr))
231

    
232
    return block_data
233

    
234

    
235
def _r2_write_block(radio, block_addr, block_size):
236
    serial = radio.pipe
237

    
238
    cmd = struct.pack(">cHb", b'W', block_addr, block_size)
239
    data = radio.get_mmap()[block_addr:block_addr + block_size]
240

    
241
    LOG.debug("Writing block %04x..." % (block_addr))
242
    LOG.debug(util.hexprint(cmd + data))
243

    
244
    try:
245
        for j in range(0, len(cmd)):
246
            serial.write(cmd[j:j + 1])
247
        for j in range(0, len(data)):
248
            serial.write(data[j:j + 1])
249
        if serial.read(1) != CMD_ACK:
250
            raise Exception("No ACK")
251
    except:
252
        _r2_exit_programming_mode(radio)
253
        raise errors.RadioError("Failed to send block "
254
                                "%04x to radio" % block_addr)
255

    
256

    
257
def do_download(radio):
258
    LOG.debug("download")
259
    _r2_enter_programming_mode(radio)
260

    
261
    data = b""
262

    
263
    status = chirp_common.Status()
264
    status.msg = "Cloning from radio"
265

    
266
    status.cur = 0
267
    status.max = radio._memsize
268

    
269
    for addr in range(0, radio._memsize, radio._block_size):
270
        status.cur = addr + radio._block_size
271
        radio.status_fn(status)
272

    
273
        block = _r2_read_block(radio, addr, radio._block_size)
274
        data += block
275

    
276
        LOG.debug("Address: %04x" % addr)
277
        LOG.debug(util.hexprint(block))
278

    
279
    _r2_exit_programming_mode(radio)
280

    
281
    return memmap.MemoryMapBytes(data)
282

    
283

    
284
def do_upload(radio):
285
    status = chirp_common.Status()
286
    status.msg = "Uploading to radio"
287

    
288
    _r2_enter_programming_mode(radio)
289

    
290
    status.cur = 0
291
    status.max = radio._memsize
292

    
293
    for start_addr, end_addr, block_size in radio._ranges:
294
        for addr in range(start_addr, end_addr, block_size):
295
            status.cur = addr + block_size
296
            radio.status_fn(status)
297
            _r2_write_block(radio, addr, block_size)
298

    
299
    _r2_exit_programming_mode(radio)
300

    
301

    
302
@directory.register
303
class RadioddityR2(chirp_common.CloneModeRadio):
304
    """Radioddity R2"""
305
    VENDOR = "Radioddity"
306
    MODEL = "R2"
307
    BAUD_RATE = 9600
308
    NEEDS_COMPAT_SERIAL = False
309

    
310
    # definitions on how to read StartAddr EndAddr BlockZize
311
    _ranges = [
312
               (0x0000, 0x01F8, 0x08),
313
               (0x01F8, 0x03F0, 0x08)
314
              ]
315
    _memsize = 0x03F0
316
    # never read more than 8 bytes at once
317
    _block_size = 0x08
318
    # frequency range is 400-470 MHz
319
    _range = [400000000, 470000000]
320
    # maximum 16 channels
321
    _upper = 16
322

    
323
    _frs16 = _pmr = False
324

    
325
    def get_features(self):
326
        rf = chirp_common.RadioFeatures()
327
        rf.has_settings = True
328
        rf.has_bank = False
329
        rf.has_tuning_step = False
330
        rf.has_name = False
331
        rf.has_offset = True
332
        rf.has_mode = True
333
        rf.has_dtcs = True
334
        rf.has_rx_dtcs = True
335
        rf.has_dtcs_polarity = True
336
        rf.has_ctone = True
337
        rf.has_cross = True
338
        rf.can_odd_split = False
339
        # FIXME: Is this right? The get_memory() has no checking for
340
        # deleted memories, but set_memory() used to reference a missing
341
        # variable likely copied from another driver
342
        rf.can_delete = False
343
        rf.valid_modes = MODE_LIST
344
        rf.valid_duplexes = ["", "-", "+", "off"]
345
        rf.valid_tmodes = ["", "Tone", "TSQL", "DTCS", "Cross"]
346
        rf.valid_cross_modes = [
347
            "Tone->DTCS",
348
            "DTCS->Tone",
349
            "->Tone",
350
            "Tone->Tone",
351
            "->DTCS",
352
            "DTCS->",
353
            "DTCS->DTCS"]
354
        rf.valid_power_levels = POWER_LEVELS
355
        rf.valid_skips = ["", "S"]
356
        rf.valid_bands = [self._range]
357
        rf.memory_bounds = (1, self._upper)
358
        rf.valid_tuning_steps = [2.5, 5.0, 6.25, 10.0, 12.5, 25.0]
359
        return rf
360

    
361
    def process_mmap(self):
362
        """Process the mem map into the mem object"""
363
        self._memobj = bitwise.parse(MEM_FORMAT, self._mmap)
364
        # to set the vars on the class to the correct ones
365

    
366
    def sync_in(self):
367
        """Download from radio"""
368
        try:
369
            data = do_download(self)
370
        except errors.RadioError:
371
            # Pass through any real errors we raise
372
            raise
373
        except:
374
            # If anything unexpected happens, make sure we raise
375
            # a RadioError and log the problem
376
            LOG.exception('Unexpected error during download')
377
            raise errors.RadioError('Unexpected error communicating '
378
                                    'with the radio')
379
        self._mmap = data
380
        self.process_mmap()
381

    
382
    def sync_out(self):
383
        """Upload to radio"""
384
        try:
385
            do_upload(self)
386
        except:
387
            # If anything unexpected happens, make sure we raise
388
            # a RadioError and log the problem
389
            LOG.exception('Unexpected error during upload')
390
            raise errors.RadioError('Unexpected error communicating '
391
                                    'with the radio')
392

    
393
    def get_raw_memory(self, number):
394
        return repr(self._memobj.memory[number - 1])
395

    
396
    def decode_tone(self, val):
397
        """Parse the tone data to decode from mem, it returns:
398
        Mode (''|DTCS|Tone), Value (None|###), Polarity (None,N,R)"""
399
        if val.get_raw() == "\xFF\xFF":
400
            return '', None, None
401

    
402
        val = int(val)
403

    
404
        if val >= 12000:
405
            a = val - 12000
406
            return 'DTCS', a, 'R'
407

    
408
        elif val >= 8000:
409
            a = val - 8000
410
            return 'DTCS', a, 'N'
411

    
412
        else:
413
            a = val / 10.0
414
            return 'Tone', a, None
415

    
416
    def encode_tone(self, memval, mode, value, pol):
417
        """Parse the tone data to encode from UI to mem"""
418
        if mode == '':
419
            memval[0].set_raw(0xFF)
420
            memval[1].set_raw(0xFF)
421
        elif mode == 'Tone':
422
            memval.set_value(int(value * 10))
423
        elif mode == 'DTCS':
424
            flag = 0x80 if pol == 'N' else 0xC0
425
            memval.set_value(value)
426
            memval[1].set_bits(flag)
427
        else:
428
            raise Exception("Internal error: invalid mode `%s'" % mode)
429

    
430
    def get_memory(self, number):
431
        bitpos = (1 << ((number - 1) % 8))
432
        bytepos = ((number - 1) / 8)
433
        LOG.debug("bitpos %s" % bitpos)
434
        LOG.debug("bytepos %s" % bytepos)
435

    
436
        _mem = self._memobj.memory[number - 1]
437

    
438
        mem = chirp_common.Memory()
439

    
440
        mem.number = number
441

    
442
        mem.freq = int(_mem.rx_freq) * 10
443

    
444
        # We'll consider any blank (i.e. 0 MHz frequency) to be empty
445
        if mem.freq == 0:
446
            mem.empty = True
447
            return mem
448

    
449
        if _mem.rx_freq.get_raw() == "\xFF\xFF\xFF\xFF":
450
            mem.freq = 0
451
            mem.empty = True
452
            return mem
453

    
454
        txfreq = int(_mem.tx_freq) * 10
455
        if txfreq == mem.freq:
456
            mem.duplex = ""
457
        elif txfreq == 0:
458
            mem.duplex = "off"
459
            mem.offset = 0
460
        # 166666665*10 is the equivalent for FF FF FF FF
461
        # stored in the TX field
462
        elif txfreq == 1666666650:
463
            mem.duplex = "off"
464
            mem.offset = 0
465
        elif txfreq < mem.freq:
466
            mem.duplex = "-"
467
            mem.offset = mem.freq - txfreq
468
        elif txfreq > mem.freq:
469
            mem.duplex = "+"
470
            mem.offset = txfreq - mem.freq
471

    
472
        # get bandwidth FM or NFM
473
        mem.mode = MODE_LIST[_mem.mode]
474

    
475
        # tone data
476
        txtone = self.decode_tone(_mem.tx_tone)
477
        rxtone = self.decode_tone(_mem.rx_tone)
478
        chirp_common.split_tone_decode(mem, txtone, rxtone)
479

    
480
        if not _mem.scanadd:
481
            mem.skip = "S"
482

    
483
        mem.power = POWER_LEVELS[_mem.power]
484

    
485
        # add extra channel settings to the OTHER tab of the properties
486
        # extra settings are unfortunately inverted
487
        mem.extra = RadioSettingGroup("extra", "Extra")
488

    
489
        bclo = RadioSetting("bclo", "Busy Lockout",
490
                            RadioSettingValueBoolean(not bool(_mem.bclo)))
491
        bclo.set_doc("Busy Lockout")
492
        mem.extra.append(bclo)
493

    
494
        scramb = RadioSetting("scramb", "Scramble",
495
                              RadioSettingValueBoolean(not bool(_mem.scramb)))
496
        scramb.set_doc("Scramble Audio Signal")
497
        mem.extra.append(scramb)
498

    
499
        compand = RadioSetting("compand", "Compander",
500
                               RadioSettingValueBoolean(
501
                                   not bool(_mem.compand)))
502
        compand.set_doc("Compress Audio for TX")
503
        mem.extra.append(compand)
504

    
505
        immutable = []
506

    
507
        if self._frs16:
508
            if mem.freq in FRS16_FREQS:
509
                if mem.number >= 1 and mem.number <= 16:
510
                    FRS_FREQ = FRS16_FREQS[mem.number - 1]
511
                    mem.freq = FRS_FREQ
512
                mem.duplex == ''
513
                mem.offset = 0
514
                mem.mode = "NFM"
515
                immutable = ["empty", "freq", "duplex", "offset", "mode"]
516
        elif self._pmr:
517
            if mem.freq in PMR_FREQS:
518
                if mem.number >= 1 and mem.number <= 16:
519
                    PMR_FREQ = PMR_FREQS[mem.number - 1]
520
                    mem.freq = PMR_FREQ
521
                mem.duplex = ''
522
                mem.offset = 0
523
                mem.mode = "NFM"
524
                mem.power = POWER_LEVELS[0]
525
                immutable = ["empty", "freq", "duplex", "offset", "mode",
526
                             "power"]
527

    
528
        mem.immutable = immutable
529

    
530
        return mem
531

    
532
    def set_memory(self, mem):
533
        bitpos = (1 << ((mem.number - 1) % 8))
534
        bytepos = ((mem.number - 1) / 8)
535
        LOG.debug("bitpos %s" % bitpos)
536
        LOG.debug("bytepos %s" % bytepos)
537

    
538
        # Get a low-level memory object mapped to the image
539
        _mem = self._memobj.memory[mem.number - 1]
540

    
541
        _rsvd = _mem.reserved.get_raw()
542

    
543
        if mem.empty:
544
            _mem.set_raw("\xFF" * 13 + _rsvd)
545
            return
546

    
547
        _mem.rx_freq = mem.freq / 10
548

    
549
        if mem.duplex == "off":
550
            for i in range(0, 4):
551
                _mem.tx_freq[i].set_raw("\xFF")
552
        elif mem.duplex == "+":
553
            _mem.tx_freq = (mem.freq + mem.offset) / 10
554
        elif mem.duplex == "-":
555
            _mem.tx_freq = (mem.freq - mem.offset) / 10
556
        else:
557
            _mem.tx_freq = mem.freq / 10
558

    
559
        # power, default power is low
560
        if mem.power:
561
            _mem.power = POWER_LEVELS.index(mem.power)
562
        else:
563
            _mem.power = 0     # low
564

    
565
        # tone data
566
        ((txmode, txtone, txpol), (rxmode, rxtone, rxpol)) = \
567
            chirp_common.split_tone_encode(mem)
568
        self.encode_tone(_mem.tx_tone, txmode, txtone, txpol)
569
        self.encode_tone(_mem.rx_tone, rxmode, rxtone, rxpol)
570

    
571
        _mem.scanadd = mem.skip != "S"
572
        _mem.mode = MODE_LIST.index(mem.mode)
573

    
574
        # extra settings are unfortunately inverted
575
        for setting in mem.extra:
576
            LOG.debug("@set_mem:", setting.get_name(), setting.value)
577
            setattr(_mem, setting.get_name(), not setting.value)
578

    
579
    def get_settings(self):
580
        _settings = self._memobj.settings
581
        basic = RadioSettingGroup("basic", "Basic Settings")
582
        top = RadioSettings(basic)
583

    
584
        rs = RadioSetting("settings.squelch", "Squelch Level",
585
                          RadioSettingValueInteger(0, 9, _settings.squelch))
586
        basic.append(rs)
587

    
588
        rs = RadioSetting("settings.timeout", "Timeout Timer",
589
                          RadioSettingValueList(
590
                              TIMEOUT_LIST, TIMEOUT_LIST[_settings.timeout]))
591

    
592
        basic.append(rs)
593

    
594
        rs = RadioSetting("settings.scanmode", "Scan Mode",
595
                          RadioSettingValueList(
596
                              SCANMODE_LIST,
597
                              SCANMODE_LIST[_settings.scanmode]))
598
        basic.append(rs)
599

    
600
        rs = RadioSetting("settings.voice", "Voice Prompts",
601
                          RadioSettingValueList(
602
                              VOICE_LIST, VOICE_LIST[_settings.voice]))
603
        basic.append(rs)
604

    
605
        rs = RadioSetting("settings.voxgain", "VOX Level",
606
                          RadioSettingValueList(
607
                              VOX_LIST, VOX_LIST[_settings.voxgain]))
608
        basic.append(rs)
609

    
610
        rs = RadioSetting("settings.voxdelay", "VOX Delay Time",
611
                          RadioSettingValueList(
612
                              VOXDELAY_LIST,
613
                              VOXDELAY_LIST[_settings.voxdelay]))
614
        basic.append(rs)
615

    
616
        rs = RadioSetting("settings.save", "Battery Save",
617
                          RadioSettingValueBoolean(_settings.save))
618
        basic.append(rs)
619

    
620
        rs = RadioSetting("settings.beep", "Beep Tone",
621
                          RadioSettingValueBoolean(_settings.beep))
622
        basic.append(rs)
623

    
624
        def _filter(name):
625
            filtered = ""
626
            for char in str(name):
627
                if char in VALID_CHARS:
628
                    filtered += char
629
                else:
630
                    filtered += " "
631
            return filtered
632

    
633
        return top
634

    
635
    def set_settings(self, settings):
636
        for element in settings:
637
            if not isinstance(element, RadioSetting):
638
                self.set_settings(element)
639
                continue
640
            else:
641
                try:
642
                    if "." in element.get_name():
643
                        bits = element.get_name().split(".")
644
                        obj = self._memobj
645
                        for bit in bits[:-1]:
646
                            obj = getattr(obj, bit)
647
                        setting = bits[-1]
648
                    else:
649
                        obj = self._memobj.settings
650
                        setting = element.get_name()
651

    
652
                    LOG.debug("Setting %s = %s" % (setting, element.value))
653
                    setattr(obj, setting, element.value)
654
                except Exception:
655
                    LOG.debug(element.get_name())
656
                    raise
657

    
658
    @classmethod
659
    def match_model(cls, filedata, filename):
660
        # This radio has always been post-metadata, so never do
661
        # old-school detection
662
        return False
663

    
664

    
665
@directory.register
666
class RetevisRT24(RadioddityR2):
667
    """Retevis RT24"""
668
    VENDOR = "Retevis"
669
    MODEL = "RT24"
670

    
671
    _pmr = False  # sold as PMR radio but supports full band TX/RX
672

    
673

    
674
@directory.register
675
class RetevisRT24V(RadioddityR2):
676
    """Retevis RT24V"""
677
    VENDOR = "Retevis"
678
    MODEL = "RT24V"
679

    
680
    # sold as FreeNet radio but supports full band TX/RX
681

    
682
    # frequency range is 136-174 MHz
683
    _range = [136000000, 174000000]
684

    
685

    
686
@directory.register
687
class RetevisH777S(RadioddityR2):
688
    """Retevis H777S"""
689
    VENDOR = "Retevis"
690
    MODEL = "H777S"
691

    
692
    _frs16 = False  # sold as FRS radio but supports full band TX/RX
(1-1/3)