From acb33551f02c63b227e12368b09dfa78505d9fc5 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 24 Jun 2024 14:39:18 -0700 Subject: [PATCH] uv17: Fix regressions from uv17pro refactor The preceding patches make some changes to the UV17Pro driver which need corresponding changes in the UV17 driver to continue working. --- chirp/drivers/baofeng_uv17.py | 1 + chirp/drivers/baofeng_uv17Pro.py | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/chirp/drivers/baofeng_uv17.py b/chirp/drivers/baofeng_uv17.py index 09b7da0ec..d5fde1670 100644 --- a/chirp/drivers/baofeng_uv17.py +++ b/chirp/drivers/baofeng_uv17.py @@ -179,6 +179,7 @@ class UV17(baofeng_uv17Pro.UV17Pro): (b"\x06", 1)] _fingerprint = b"\x06" + b"UV15999" _scode_offset = 1 + _mem_positions = () _tri_band = False POWER_LEVELS = [chirp_common.PowerLevel("Low", watts=1.00), diff --git a/chirp/drivers/baofeng_uv17Pro.py b/chirp/drivers/baofeng_uv17Pro.py index 3433581d6..6cf181724 100644 --- a/chirp/drivers/baofeng_uv17Pro.py +++ b/chirp/drivers/baofeng_uv17Pro.py @@ -521,13 +521,18 @@ def get_settings_common_dtmf(self, dtmfe, _mem): # Signal Code Name _nameobj = self._memobj.pttid[i] - rs = RadioSetting("pttid/%i.name" % i, - "Signal Code %i Name" % (i + 1), - RadioSettingValueString( - 0, 10, self._filterCodeName(_nameobj.name), - False, CHARSET_GB2312)) - rs.set_apply_callback(self.apply_codename, _nameobj) - dtmfe.append(rs) + try: + rs = RadioSetting( + "pttid/%i.name" % i, + "Signal Code %i Name" % (i + 1), + RadioSettingValueString( + 0, 10, self._filterCodeName(_nameobj.name), + False, CHARSET_GB2312)) + rs.set_apply_callback(self.apply_codename, _nameobj) + dtmfe.append(rs) + except AttributeError: + # UV17, et al do not have pttid.name + pass _codeobj = self._memobj.ani.code _code = "".join([DTMF_CHARS[x] for x in _codeobj if int(x) < 0x1F])