# HG changeset patch # User Jens Jensen # Date 1386082517 21600 # Tue Dec 03 08:55:17 2013 -0600 # Node ID 15f304398b3bf5ac2928d1df39692303bbcbe9c6 # Parent c1271344c63cbba1919fa290b857a33e1bb1bae5 [uvb5] move from list of known acks to using first ack received throughout download session #1281 diff -r c1271344c63c -r 15f304398b3b chirp/uvb5.py --- a/chirp/uvb5.py Mon Dec 02 09:59:32 2013 -0800 +++ b/chirp/uvb5.py Tue Dec 03 08:55:17 2013 -0600 @@ -184,7 +184,7 @@ do_ident(radio) data = "KT511 Radio Program data v1.08\x00\x00" data += ("\x00" * 16) - + firstack = None for i in range(0, 0x1000, 16): frame = struct.pack(">cHB", "R", i, 16) radio.pipe.write(frame) @@ -194,9 +194,13 @@ raise errors.RadioError("Invalid response for address 0x%04x" % i) radio.pipe.write("\x06") ack = radio.pipe.read(1) - if ack not in UVB5_ACKS: - print "ack received:", util.hexprint(ack) - raise errors.RadioError("Unexpected response") + if not firstack: + firstack = ack + else: + if not ack == firstack: + print "first ack:", util.hexprint(firstack), \ + "ack received:", util.hexprint(ack) + raise errors.RadioError("Unexpected response") data += result[4:] do_status(radio, "from", i) @@ -224,7 +228,6 @@ } POWER_LEVELS = [chirp_common.PowerLevel("Low", watts=1), chirp_common.PowerLevel("High", watts=5)] -UVB5_ACKS = ['\x48', '\x74', '\x78', '\x1f', '\x29'] @directory.register class BaofengUVB5(chirp_common.CloneModeRadio,