[chirp_devel] [PATCH] [UV-5X3] Add support for the MTC's UV-5R-3

Jim Unroe
Fri Nov 3 17:39:27 PDT 2017


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1509755069 14400
# Node ID 8038c6e15a0e7384d208de2291f7097ab4115649
# Parent  7cd9e08d2fae82c9272b71226ca63273716f947c
[UV-5X3] Add support for the MTC's UV-5R-3

This patch adds support for the Main Trading Company's  UV-5R-3 tri-band
handheld radio.

related to #5309

diff -r 7cd9e08d2fae -r 8038c6e15a0e chirp/drivers/uv5x3.py
--- a/chirp/drivers/uv5x3.py	Thu Oct 12 07:20:04 2017 -0700
+++ b/chirp/drivers/uv5x3.py	Fri Nov 03 20:24:29 2017 -0400
@@ -36,6 +36,9 @@
 # BTECH UV-5X3 magic string
 MSTRING_UV5X3 = "\x50\x0D\x0C\x20\x16\x03\x28"
 
+# MTC UV-5R-3 magic string
+MSTRING_UV5R3 = "\x50\x0D\x0C\x20\x17\x09\x19"
+
 ##### ID strings #####################################################
 
 # BTECH UV-5X3
@@ -43,6 +46,9 @@
 UV5X3_fp2 = "UVVG301"  # UVV300 original
 UV5X3_fp3 = "UVVG306"  # UVV306 original
 
+# MTC UV-5R-3
+UV5R3_fp1 = "5R31709"
+
 DTMF_CHARS = " 1234567890*#ABCD"
 STEPS = [2.5, 5.0, 6.25, 10.0, 12.5, 20.0, 25.0, 50.0]
 
@@ -384,9 +390,7 @@
     def get_prompts(cls):
         rp = chirp_common.RadioPrompts()
         rp.experimental = \
-            ('The BTech UV-5X3 driver is a beta version.\n'
-             '\n'
-             'Please save an unedited copy of your first successful\n'
+            ('Please save an unedited copy of your first successful\n'
              'download to a CHIRP Radio Images(*.img) file.'
              )
         rp.pre_download = _(dedent("""\
@@ -664,7 +668,7 @@
                               0, 7, _filter(_msg.line2)))
         other.append(rs)
 
-        if str(_mem.firmware_msg.line1) == "UVVG302":
+        if str(_mem.firmware_msg.line1) == ("UVVG302" or "5R31709"):
             lower = 136
             upper = 174
         else:
@@ -683,6 +687,9 @@
         if str(_mem.firmware_msg.line1) == "UVVG302":
             lower = 200
             upper = 230
+        elif str(_mem.firmware_msg.line1) == "5R31709":
+            lower = 200
+            upper = 260
         else:
             lower = 220
             upper = 225
@@ -1200,3 +1207,17 @@
             return True
         else:
             return False
+
+
+ at directory.register
+class MTCUV5R3Radio(UV5X3):
+    VENDOR = "MTC"
+    MODEL = "UV-5R-3"
+
+    _fileid = [UV5R3_fp1, ]
+
+    _magic = [MSTRING_UV5R3, ]
+
+    VALID_BANDS = [(136000000, 174000000),
+                   (200000000, 260000000),
+                   (400000000, 521000000)]



More information about the chirp_devel mailing list