[chirp_devel] [PATCH] [UV-82] Add support for Baofeng UV-82 VHF/UHF transceiver

Jim Unroe
Tue Jul 9 19:18:29 PDT 2013


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1373422432 14400
# Node ID bf90ba41e4115f15c698e99442162be4882ce213
# Parent  3f9a95820f7dd2bdf7cc53f79b7661e93bacfcc1
[UV-82] Add support for Baofeng UV-82 VHF/UHF transceiver
#961

diff -r 3f9a95820f7d -r bf90ba41e411 chirp/uv5r.py
--- a/chirp/uv5r.py	Fri Jul 05 19:03:33 2013 -0700
+++ b/chirp/uv5r.py	Tue Jul 09 22:13:52 2013 -0400
@@ -112,6 +112,7 @@
   u8 rptrl;
   u8 ponmsg;
   u8 roger;
+  u8 rogerrx;
 } settings[2];
 
 #seekto 0x0E52;
@@ -245,7 +246,7 @@
 MODE_LIST = ["Channel", "Name", "Frequency"]
 COLOR_LIST = ["Off", "Blue", "Orange", "Purple"]
 ALMOD_LIST = ["Site", "Tone", "Code"]
-TDRAB_LIST = ["Off", "A", "B"]
+TDRAB_LIST = ROGERRX_LIST = ["Off", "A", "B"]
 PONMSG_LIST = ["Full", "Message"]
 RPSTE_LIST = ["%s" % x for x in range(1, 11, 1)]
 RPSTE_LIST.insert(0, "OFF")
@@ -268,6 +269,7 @@
     "txled" : COLOR_LIST,
     "almod" : ALMOD_LIST,
     "tdrab" : TDRAB_LIST,
+    "rogerrx" : ROGERRX_LIST,
     "ponmsg" : PONMSG_LIST,
     "rpste" : RPSTE_LIST,
     "stedelay" : STEDELAY_LIST,
@@ -297,6 +299,7 @@
 UV5R_MODEL_ORIG = "\x50\xBB\xFF\x01\x25\x98\x4D"
 UV5R_MODEL_291 = "\x50\xBB\xFF\x20\x12\x07\x25"
 UV5R_MODEL_F11 = "\x50\xBB\xFF\x13\xA1\x11\xDD"
+UV82_MODEL =     "\x50\xBB\xFF\x20\x13\x01\x05"
 
 def _upper_band_from_data(data):
     return data[0x03:0x04]
@@ -420,7 +423,7 @@
     print "Image is %s" % repr(image_version)
     print "Radio is %s" % repr(radio_version)
 
-    if "BFB" not in radio_version and "USA" not in radio_version:
+    if "BFB" not in radio_version and "BF82" not in radio_version and "USA" not in radio_version:
         raise errors.RadioError("Unsupported firmware version: `%s'" %
                                 radio_version)
 
@@ -723,6 +726,8 @@
                 idx = version_tag.index("BFB") + 3
                 version = int(version_tag[idx:idx+3])
                 return version < 291
+            if 'BF82' in version_tag:
+                return False
             if 'USA' in version_tag:
                 return False
         except:
@@ -735,6 +740,9 @@
         if 'BFB' in version_tag:
             idx = version_tag.index("BFB") + 3
             return int(version_tag[idx:idx+3])
+        elif 'BF' in version_tag:
+            idx = version_tag.index("BF") + 2
+            return int(version_tag[idx:idx+4])
         elif 'USA' in version_tag:
             idx = version_tag.index("USA") + 3
             return int(version_tag[idx:idx+3])
@@ -789,15 +797,15 @@
                                                 TIMEOUT_LIST[_settings.timeout]))
         basic.append(rs)
 
-        if self._my_version() >= 251:
+        if self._is_orig() and self._my_version() < 251:
+            rs = RadioSetting("voice", "Voice",
+                              RadioSettingValueBoolean(_settings.voice))
+            advanced.append(rs)
+        else:
             rs = RadioSetting("voice", "Voice",
                               RadioSettingValueList(VOICE_LIST,
                                                     VOICE_LIST[_settings.voice]))
             advanced.append(rs)
-        else:
-            rs = RadioSetting("voice", "Voice",
-                              RadioSettingValueBoolean(_settings.voice))
-            advanced.append(rs)
 
         rs = RadioSetting("screv", "Scan Resume",
                           RadioSettingValueList(RESUME_LIST,
@@ -841,9 +849,18 @@
                                                 COLOR_LIST[_settings.txled]))
         basic.append(rs)
 
-        rs = RadioSetting("roger", "Roger Beep",
-                          RadioSettingValueBoolean(_settings.roger))
-        basic.append(rs)
+        if self._my_version() < 8215:
+            rs = RadioSetting("roger", "Roger Beep",
+                              RadioSettingValueBoolean(_settings.roger))
+            basic.append(rs)
+        else:
+            rs = RadioSetting("roger", "Roger Beep (TX)",
+                              RadioSettingValueBoolean(_settings.roger))
+            basic.append(rs)
+            rs = RadioSetting("rogerrx", "Roger Beep (RX)",
+                              RadioSettingValueList(ROGERRX_LIST,
+                                                    ROGERRX_LIST[_settings.rogerrx]))
+            basic.append(rs)
 
         rs = RadioSetting("ste", "Squelch Tail Eliminate (HT to HT)",
                           RadioSettingValueBoolean(_settings.ste))
@@ -1078,7 +1095,7 @@
                                                 options[self._memobj.vfob.scode]))
         workmode.append(rs)
 
-        if self._my_version() >= 291:
+        if not self._is_orig():
             rs = RadioSetting("vfoa.step", "VFO A Tuning Step",
                               RadioSettingValueList(STEP291_LIST,
                                                     STEP291_LIST[self._memobj.vfoa.step]))
@@ -1221,3 +1238,9 @@
     MODEL = "F-11"
     _basetype = "USA"
     _idents = [UV5R_MODEL_F11]
+
+ at directory.register
+class BaofengUV82Radio(BaofengUV5R):
+    MODEL = "UV-82"
+    _basetype = "BF82"
+    _idents = [UV82_MODEL]



More information about the chirp_devel mailing list