Skip to content

Commit

Permalink
Fix idrp python3 conversion
Browse files Browse the repository at this point in the history
Fixes #11252

Co-Authored-By: Dan Smith <[email protected]>
  • Loading branch information
cmlara and kk7ds committed May 14, 2024
1 parent d5dc5c8 commit 3fed8b4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions chirp/drivers/idrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions chirp/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions rpttool
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3fed8b4

Please sign in to comment.