# HG changeset patch # User Jim Unroe rock.unroe@gmail.com # Date 1582683996 18000 # Tue Feb 25 21:26:36 2020 -0500 # Node ID ab6ca42bf1e7427ef63c5c787812c3c2b7f52ed4 # Parent 6633e053349f1371b43a81773a7aad1478a80920 [RT24] Add support for Retevis RT24
A patch to provided support for the Retevis RT 24 was offered by Metthias Larisch. This is the same patch with style changes to pass pep8 tests and submitted by Mercurial.
related to #6193
diff -r 6633e053349f -r ab6ca42bf1e7 chirp/drivers/radioddity_r2.py --- a/chirp/drivers/radioddity_r2.py Tue Feb 11 18:32:19 2020 -0800 +++ b/chirp/drivers/radioddity_r2.py Tue Feb 25 21:26:36 2020 -0500 @@ -90,6 +90,7 @@ """
CMD_ACK = "\x06" +CMD_ALT_ACK = "\x53" CMD_STX = "\x02" CMD_ENQ = "\x05"
@@ -146,8 +147,8 @@ raise errors.RadioError("Error communicating with radio")
# No idea yet what the next 7 bytes stand for - # as long as they start with ACK we are fine - if not ident.startswith(CMD_ACK): + # as long as they start with ACK (or ALT_ACK on some devices) we are fine + if not ident.startswith(CMD_ACK) and not ident.startswith(CMD_ALT_ACK): _r2_exit_programming_mode(radio) LOG.debug(util.hexprint(ident)) raise errors.RadioError("Radio returned unknown identification string") @@ -297,8 +298,7 @@ _r2_exit_programming_mode(radio)
-@directory.register -class RadioddityR2Radio(chirp_common.CloneModeRadio): +class RadioddityR2(chirp_common.CloneModeRadio): """Radioddity R2""" VENDOR = "Radioddity" MODEL = "R2" @@ -620,3 +620,13 @@ # This radio has always been post-metadata, so never do # old-school detection return False + + +class RT24Alias(chirp_common.Alias): + VENDOR = "Retevis" + MODEL = "RT24" + + +@directory.register +class RadioddityR2Generic(RadioddityR2): + ALIASES = [RT24Alias]