0001-New-Model-Retevis-RT24-Aliases-Radioddity-R2.patch

Matthias Larisch, 10/25/2018 04:40 am

Download (2.1 kB)

b/chirp/drivers/radioddity_r2.py
90 90
"""
91 91

  
92 92
CMD_ACK = "\x06"
93
CMD_ALT_ACK = "\x53"
93 94
CMD_STX = "\x02"
94 95
CMD_ENQ = "\x05"
95 96

  
......
146 147
        raise errors.RadioError("Error communicating with radio")
147 148

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

  
299 300

  
300
@directory.register
301
class RadioddityR2Radio(chirp_common.CloneModeRadio):
301
class RadioddityR2(chirp_common.CloneModeRadio):
302 302
    """Radioddity R2"""
303 303
    VENDOR = "Radioddity"
304 304
    MODEL = "R2"
......
618 618
        # This radio has always been post-metadata, so never do
619 619
        # old-school detection
620 620
        return False
621

  
622
class RT24Alias(chirp_common.Alias):
623
    VENDOR = "Retevis"
624
    MODEL = "RT24"
625

  
626
@directory.register
627
class RadioddityR2Generic(RadioddityR2):
628
    ALIASES = [RT24Alias]
621
-