mirror of
https://github.com/kk7ds/chirp
synced 2026-08-13 17:51:36 -04:00
Fix idrp python3 conversion
Fixes #11252 Co-Authored-By: Dan Smith <dsmith@danplanet.com>
This commit is contained in:
parent
d5dc5c8e05
commit
3fed8b4a8d
3 changed files with 11 additions and 11 deletions
|
|
@ -81,7 +81,7 @@ def set_freq(pipe, freq):
|
|||
resp = send(pipe, buf)
|
||||
for frame in resp:
|
||||
if len(frame) == 6:
|
||||
if frame[4] == b"\xfb":
|
||||
if frame[4] == 251:
|
||||
return True
|
||||
|
||||
raise errors.InvalidDataError("Repeater reported error")
|
||||
|
|
@ -96,14 +96,14 @@ def get_freq(pipe):
|
|||
resp = send(pipe, buf)
|
||||
|
||||
for frame in resp:
|
||||
if frame[4] == b"\x03":
|
||||
if frame[4] == 3:
|
||||
els = frame[5:10]
|
||||
|
||||
freq = int("%02x%02x%02x%02x%02x" % (ord(els[4]),
|
||||
ord(els[3]),
|
||||
ord(els[2]),
|
||||
ord(els[1]),
|
||||
ord(els[0])))
|
||||
freq = int("%02x%02x%02x%02x%02x" % (els[4],
|
||||
els[3],
|
||||
els[2],
|
||||
els[1],
|
||||
els[0]))
|
||||
LOG.debug("Freq: %f" % freq)
|
||||
return freq
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -86,9 +86,9 @@ def bcd_encode(val, bigendian=True, width=None):
|
|||
digits = []
|
||||
while val != 0:
|
||||
digits.append(val % 10)
|
||||
val /= 10
|
||||
val //= 10
|
||||
|
||||
result = ""
|
||||
result = b""
|
||||
|
||||
if len(digits) % 2 != 0:
|
||||
digits.append(0)
|
||||
|
|
|
|||
4
rpttool
4
rpttool
|
|
@ -86,8 +86,8 @@ def _set_freq(rp):
|
|||
return True
|
||||
|
||||
|
||||
def set_freq():
|
||||
rp = open_device()
|
||||
def set_freq(dev):
|
||||
rp = open_device(dev)
|
||||
if not rp:
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue