# HG changeset patch
# User Jim Unroe <
rock.unroe@gmail.com>
# Date 1625340946 14400
# Sat Jul 03 15:35:46 2021 -0400
# Node ID b845893bebcdeba1754abe44c423c823ffafce1c
# Parent 0eab8146b294ef686ca4a49c17ea38abde54c7ab
[RB26] Fix for varying ACK
The RB26 sometimes ACKs the "magic" string with a "\x00\x06" and sometimes it
ACKs with only a "\x06". CHIRP currently expects to see the "\x00\x06" as the
response so the process fails if the "\x00" is missing.
This patch "chews up" the "\x00 if present and then only the individual
"\x06" is expected as the ACK.
The Retevis RT76 seems to have the same issue and is fixed as a result of this
patch.
Fixes #9035
diff -r 0eab8146b294 -r b845893bebcd chirp/drivers/retevis_rt21.py
--- a/chirp/drivers/retevis_rt21.py Sat Jul 03 14:13:35 2021 -0400
+++ b/chirp/drivers/retevis_rt21.py Sat Jul 03 15:35:46 2021 -0400
@@ -297,9 +297,9 @@
exito = False
for i in range(0, 5):
serial.write(radio._magic)
- if radio.MODEL == "RB26" or radio.MODEL == "RT76":
- serial.read(1)
ack = serial.read(1)
+ if ack == "\x00":
+ ack = serial.read(1)
try:
if ack == CMD_ACK: