[chirp_devel] Fwd: [PATCH] [UV-5R] Incorrect Tone Values for ANI/PTT-ID

Jim Unroe
Wed Oct 21 16:58:21 PDT 2020


I don't know if this will work or not, but it seems lately that after
I spend a bunch of time getting my patch uploads to work, the next
time I try they get rejected. This is like the third time. :-(

Recipient address rejected: blocked by RBL:
rbl:b.barracudacentral.org:<http://www.barracudanetworks.com/reputation/?pr=1&ip=69.12.75.122>

Anyway, I forwarded this copy that was sent to me. Fingers crossed.

Jim KC9HI

---------- Forwarded message ---------
From: Jim Unroe <Rock.Unroe at gmail.com>
Date: Wed, Oct 21, 2020 at 7:52 PM
Subject: [PATCH] [UV-5R] Incorrect Tone Values for ANI/PTT-ID
To: <chirp_devel at intrepid.danplanet.com>
Cc: <rock.unroe at gmail.com>


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1603305640 14400
#      Wed Oct 21 14:40:40 2020 -0400
# Node ID fdf3c9d0165b70296340dc85758047873c96c641
# Parent  98b8a850b0f136c77fe09a4922c32a2a28f708be
[UV-5R] Incorrect Tone Values for ANI/PTT-ID

This patch addresses the changes to the "dtmfchars" brought about by the
HN5RV01 firmware.

While making these changes it was also discovered that the ANI code for these
radios is limited to only numeric DTMF characters. This patch also makes this
correction.

Fixes #8321

diff -r 98b8a850b0f1 -r fdf3c9d0165b chirp/drivers/uv5r.py
--- a/chirp/drivers/uv5r.py     Sun Oct 11 15:39:26 2020 -0400
+++ b/chirp/drivers/uv5r.py     Wed Oct 21 14:40:40 2020 -0400
@@ -1561,7 +1561,11 @@

         dtmf = RadioSettingGroup("dtmf", "DTMF Settings")
         group.append(dtmf)
-        dtmfchars = "0123456789 *#ABCD"
+
+        if str(self._memobj.firmware_msg.line1) == "HN5RV01":
+            dtmfchars = "0123456789ABCD*#"
+        else:
+            dtmfchars = "0123456789 *#ABCD"

         for i in range(0, 15):
             _codeobj = self._memobj.pttid[i].code
@@ -1582,10 +1586,12 @@
             rs.set_apply_callback(apply_code, self._memobj.pttid[i])
             dtmf.append(rs)

+        dtmfcharsani = "0123456789"
+
         _codeobj = self._memobj.ani.code
-        _code = "".join([dtmfchars[x] for x in _codeobj if int(x) < 0x1F])
+        _code = "".join([dtmfcharsani[x] for x in _codeobj if int(x) < 0x1F])
         val = RadioSettingValueString(0, 5, _code, False)
-        val.set_charset(dtmfchars)
+        val.set_charset(dtmfcharsani)
         rs = RadioSetting("ani.code", "ANI Code", val)

         def apply_code(setting, obj):



More information about the chirp_devel mailing list