[chirp_devel] [PATCH] [UV-5R] Add Service Settings for Squelch

Jim Unroe
Mon Jan 5 19:14:11 PST 2015


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1420507314 18000
# Node ID 4e49d552ace0a877e6df1544e952309cdd79fc36
# Parent  0ccddc8155647a3fb78d2eda13b098e7c2b59f94
[UV-5R] Add Service Settings for Squelch

Create sturcture to expose settings
Add "Service Settings" menu
Add VHF and UHF Squelch settings

#2165

diff -r 0ccddc815564 -r 4e49d552ace0 chirp/uv5r.py
--- a/chirp/uv5r.py	Thu Jan 01 19:02:09 2015 +0100
+++ b/chirp/uv5r.py	Mon Jan 05 20:21:54 2015 -0500
@@ -246,6 +246,34 @@
   struct limit uhf;
 } limits_old;
 
+struct squelch {
+  u8 sql0;
+  u8 sql1;
+  u8 sql2;
+  u8 sql3;
+  u8 sql4;
+  u8 sql5;
+  u8 sql6;
+  u8 sql7;
+  u8 sql8;
+  u8 sql9;
+};
+
+#seekto 0x18A8;
+struct {
+  struct squelch vhf;
+  u8 unknown1[6];
+  u8 unknown2[16];
+  struct squelch uhf;
+} squelch_new;
+
+#seekto 0x18E8;
+struct {
+  struct squelch vhf;
+  u8 unknown[6];
+  struct squelch uhf;
+} squelch_old;
+
 """
 
 # 0x1EC0 - 0x2000
@@ -952,6 +980,7 @@
     def _get_settings(self):
         _ani = self._memobj.ani
         _settings = self._memobj.settings
+        _squelch = self._memobj.squelch_new
         _vfoa = self._memobj.vfoa
         _vfob = self._memobj.vfob
         _wmchannel = self._memobj.wmchannel
@@ -1496,6 +1525,23 @@
                                                 DTMFSPEED_LIST[val]))
         dtmf.append(rs)
 
+        #if not self._is_orig():
+        if not self._my_version() < 291:
+            service = RadioSettingGroup("service", "Service Settings")
+            group.append(service)
+
+            for band in ["vhf", "uhf"]:
+                for index in range(0, 10):
+                    key = "squelch_new.%s.sql%i" % (band, index)
+                    if band == "vhf":
+                        _obj = self._memobj.squelch_new.vhf
+                    elif band == "uhf":
+                        _obj = self._memobj.squelch_new.uhf
+                    name = "%s Squelch %i" % (band.upper(), index)
+                    rs = RadioSetting(key, name, RadioSettingValueInteger(
+                                      0, 64, getattr(_obj, "sql%i" % (index))))
+                    service.append(rs)
+
         return group
 
     def get_settings(self):



More information about the chirp_devel mailing list