[chirp_devel] [PATCH] [F8HP] Add Support for Baofeng F8HP with Custom Firmware

Jim Unroe
Mon Jul 14 17:11:27 PDT 2014


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1405383030 14400
# Node ID 2df0e46fe981e46c85213cbd7847d4628e378d11
# Parent  fa902fc78810dae3a383a025c710eb575145fa1c
[F8HP] Add Support for Baofeng F8HP with Custom Firmware

Except for the firmware, this radio is nearly identical to the Intek KT-980HP

Add BASETYPE and BASETYPE_LIST support

Rework code so that KT-980HP settings are also used for BF-F8HP

Update logic for powerlevels to use "==" intead of "!=" to be consistent
with other similar settings

Add code to DTMF Speed settings to prevent errors with out-of-range values

Add subclass for Baofeng BF-F8HP

#1765

diff -r fa902fc78810 -r 2df0e46fe981 chirp/uv5r.py
--- a/chirp/uv5r.py	Mon Jul 07 19:42:15 2014 -0400
+++ b/chirp/uv5r.py	Mon Jul 14 20:10:30 2014 -0400
@@ -257,9 +257,11 @@
 BASETYPE_UV82 = ["US2S", "B82S", "BF82"]
 BASETYPE_BJ55 = ["BJ55"]          # needed for for the Baojie UV-55 in bjuv55.py
 BASETYPE_UV6  = ["BF1"]
-BASETYPE_KT980HP = ["BFP3"]
+BASETYPE_KT980HP = ["BFP3V3 B"]
+BASETYPE_F8HP = ["BFP3V3 F"]
 BASETYPE_LIST = BASETYPE_UV5R + BASETYPE_F11 + BASETYPE_UV82 + \
-                BASETYPE_BJ55 + BASETYPE_UV6 + BASETYPE_KT980HP
+                BASETYPE_BJ55 + BASETYPE_UV6 + BASETYPE_KT980HP + \
+                BASETYPE_F8HP
 
 AB_LIST = ["A", "B"]
 ALMOD_LIST = ["Site", "Tone", "Code", "_unknown_"]
@@ -736,7 +738,7 @@
         if not _mem.scan:
             mem.skip = "S"
 
-        if self.MODEL == "KT-980HP":
+        if self.MODEL == "KT-980HP" or self.MODEL == "BF-F8HP":                          
             levels = UV5R_POWER_LEVELS3
         else:
             levels = UV5R_POWER_LEVELS
@@ -842,7 +844,7 @@
         _mem.wide = mem.mode == "FM"
 
         if mem.power:
-            if self.MODEL == "KT-980HP":
+            if self.MODEL == "KT-980HP" or self.MODEL == "BF-F8HP":
                 levels = [str(l) for l in UV5R_POWER_LEVELS3]
                 _mem.lowpower = levels.index(str(mem.power))
             else:
@@ -1283,7 +1285,19 @@
             rs.set_apply_callback(apply_offset, _vfob)
             workmode.append(rs)
 
-            if self.MODEL != "KT-980HP":
+            if self.MODEL == "KT-980HP" or self.MODEL == "BF-F8HP":
+                rs = RadioSetting("vfoa.txpower3", "VFO A Power",
+                                  RadioSettingValueList(TXPOWER3_LIST,
+                                                        TXPOWER3_LIST[
+                                                        _vfoa.txpower3]))
+                workmode.append(rs)
+
+                rs = RadioSetting("vfob.txpower3", "VFO B Power",
+                                  RadioSettingValueList(TXPOWER3_LIST,
+                                                        TXPOWER3_LIST[
+                                                        _vfob.txpower3]))
+                workmode.append(rs)
+            else:
                 rs = RadioSetting("vfoa.txpower", "VFO A Power",
                                   RadioSettingValueList(TXPOWER_LIST,
                                                         TXPOWER_LIST[
@@ -1295,18 +1309,6 @@
                                                         TXPOWER_LIST[
                                                         _vfob.txpower]))
                 workmode.append(rs)
-            else:
-                rs = RadioSetting("vfoa.txpower3", "VFO A Power",
-                                  RadioSettingValueList(TXPOWER3_LIST,
-                                                        TXPOWER3_LIST[
-                                                        _vfoa.txpower3]))
-                workmode.append(rs)
-
-                rs = RadioSetting("vfob.txpower3", "VFO B Power",
-                                  RadioSettingValueList(TXPOWER3_LIST,
-                                                        TXPOWER3_LIST[
-                                                        _vfob.txpower3]))
-                workmode.append(rs)
 
 
             rs = RadioSetting("vfoa.widenarr", "VFO A Bandwidth",
@@ -1429,14 +1431,22 @@
                                                 DTMFST_LIST[_settings.dtmfst]))
         dtmf.append(rs)
 
+        if _ani.dtmfon > 0xC3:
+            val = 0x00
+        else:
+            val = _ani.dtmfon
         rs = RadioSetting("ani.dtmfon", "DTMF Speed (on)",
                           RadioSettingValueList(DTMFSPEED_LIST,
-                                                DTMFSPEED_LIST[_ani.dtmfon]))
+                                                DTMFSPEED_LIST[val]))
         dtmf.append(rs)
 
+        if _ani.dtmfoff > 0xC3:
+            val = 0x00
+        else:
+            val = _ani.dtmfoff
         rs = RadioSetting("ani.dtmfoff", "DTMF Speed (off)",
                           RadioSettingValueList(DTMFSPEED_LIST,
-                                                DTMFSPEED_LIST[_ani.dtmfoff]))
+                                                DTMFSPEED_LIST[val]))
         dtmf.append(rs)
 
         return group
@@ -1567,3 +1577,21 @@
     def _is_orig(self):
         # Override this for KT980HP to always return False
         return False
+
+ at directory.register
+class BaofengBFF8HPRadio(BaofengUV5R):
+    VENDOR = "Baofeng"
+    MODEL = "BF-F8HP"
+    _basetype = BASETYPE_F8HP
+    _idents = [UV5R_MODEL_291]
+    _vhf_range = (130000000, 180000000)
+    _uhf_range = (400000000, 521000000)
+
+    def get_features(self):
+        rf = BaofengUV5R.get_features(self)
+        rf.valid_power_levels = UV5R_POWER_LEVELS3
+        return rf
+
+    def _is_orig(self):
+        # Override this for BFF8HP to always return False
+        return False



More information about the chirp_devel mailing list