[chirp_devel] [PATCH] [UV-B5] Fix for "Unsupported Model" error when downloading or uploading

Jim Unroe
Sat Jul 27 08:45:03 PDT 2013


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1374939742 14400
# Node ID 2740041ef55ec67e5e76707326204fe8c9f4ef73
# Parent  3c63f420a266899e1d399eef4da442c1b5af7cb7
[UV-B5] Fix for "Unsupported Model" error when downloading or uploading
When certain settings of the UV-B5 or UV-B6 are changed, one
or both of the following can happen
- the 'ident' of the radio changes
- the 'ack' check value changes
This patch attempts to address both of these issues
#947 and others

diff -r 3c63f420a266 -r 2740041ef55e chirp/uvb5.py
--- a/chirp/uvb5.py	Sun Jul 21 08:08:01 2013 -0400
+++ b/chirp/uvb5.py	Sat Jul 27 11:42:22 2013 -0400
@@ -102,7 +102,7 @@
     radio.pipe.write("\x02")
     ident = radio.pipe.read(8)
     print util.hexprint(ident)
-    if ident != "HKT511\x00\x04":
+    if not ident.startswith('HKT511'):
         raise errors.RadioError("Unsupported model")
     radio.pipe.write("\x06")
     ack = radio.pipe.read(1)
@@ -129,8 +129,9 @@
             print util.hexprint(result)
             raise errors.RadioError("Invalid response for address 0x%04x" % i)
         radio.pipe.write("\x06")
-        ecks = radio.pipe.read(1)
-        if ecks != "x":
+        ack = radio.pipe.read(1)
+        if ack not in ('\x74', '\x78', '\x1f'):
+            print util.hexprint(ack)
             raise errors.RadioError("Unexpected response")
         data += result[4:]
         do_status(radio, "from", i)



More information about the chirp_devel mailing list