[chirp_devel] Fwd: [PATCH] [TH-UV88] Fix missing settings tab due to out-of-range value. #8683

Jim Unroe
Wed Feb 17 16:40:29 PST 2021


---------- Forwarded message ---------
From: Jim Unroe <kc9hi at comcast.net>
Date: Wed, Feb 17, 2021 at 7:39 PM
Subject: [PATCH] [TH-UV88] Fix missing settings tab due to
out-of-range value. #8683
To: <Rock.Unroe at gmail.com>


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1613608180 18000
#      Wed Feb 17 19:29:40 2021 -0500
# Node ID bb57aa1dd1b7f3fb279f3455bbab584d61e14c41
# Parent  5249ae1ee57bb1e7cd45ddba6bde11a68a507673
[TH-UV88] Fix missing settings tab due to out-of-range value.             #8683

This patch addresses the out-of-range (or lack of) region code that seems
to be present in more recent firmware versions by...


- extending the region code list for unknown values from 5 to 15.
- logging region code values from 5 to 15 to debug.log file.

With contributions from Ruddolph Gutzerhagen.

diff -r 5249ae1ee57b -r bb57aa1dd1b7 chirp/drivers/th_uv88.py
--- a/chirp/drivers/th_uv88.py  Thu Feb 11 15:40:16 2021 -0800
+++ b/chirp/drivers/th_uv88.py  Wed Feb 17 19:29:40 2021 -0500
@@ -168,10 +168,13 @@

 #seekto 0x191E;
 struct {
-  u8 region;              // 0x191E Radio Region (read only)
+  u8 unknown191e:4,       //
+     region:4;            // 0x191E Radio Region (read only)
                           // 0 = Unlocked  TX: 136-174 MHz / 400-480 MHz
+                          // 2-3 = Unknown
                           // 3 = EU        TX: 144-146 MHz / 430-440 MHz
                           // 4 = US        TX: 144-148 MHz / 420-450 MHz
+                          // 5-15 = Unknown
 } settings2;

 #seekto 0x1940;
@@ -878,6 +881,14 @@
         advanced.append(rset)

         options = ['Unlocked', 'Unknown 1', 'Unknown 2', 'EU', 'US']
+        # extend option list with unknown description for values 5 - 15.
+        for ix in range(len(options), _settings2.region + 1):
+            item_to_add = 'Unknown {region_code}'.format(region_code=ix)
+            options.append(item_to_add)
+        # log unknown region codes greater than 4
+        if _settings2.region > 4:
+            LOG.debug("Unknown region code: {value}".
+                      format(value=_settings2.region))
         rx = RadioSettingValueList(options, options[_settings2.region])
         rx.set_mutable(False)
         rset = RadioSetting("settings2.region", "Region", rx)



More information about the chirp_devel mailing list