Skip to content

Commit

Permalink
uv17: Fix regressions from uv17pro refactor
Browse files Browse the repository at this point in the history
The preceding patches make some changes to the UV17Pro driver which
need corresponding changes in the UV17 driver to continue working.
  • Loading branch information
kk7ds committed Jul 16, 2024
1 parent 085daae commit acb3355
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions chirp/drivers/baofeng_uv17.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
19 changes: 12 additions & 7 deletions chirp/drivers/baofeng_uv17Pro.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit acb3355

Please sign in to comment.