diff sirf.py @ 4:2fde8c382dae

SiRF uses a 15 bit checksum, see section 1-2
author Daniel O'Connor <darius@dons.net.au>
date Wed, 20 Jun 2012 16:48:55 +0930
parents 387e6e928567
children f3547b32c7c5
line wrap: on
line diff
--- a/sirf.py	Wed Sep 02 17:47:37 2009 +0930
+++ b/sirf.py	Wed Jun 20 16:48:55 2012 +0930
@@ -242,7 +242,7 @@
         out.append((dlen & 0xff00) >> 8)
         out.append(dlen & 0xff)
         out.extend(data)
-        out.append((cksum & 0xff00) >> 8)
+        out.append((cksum & 0x7f00) >> 8) # 15 bit checksum
         out.append(cksum & 0xff)
         out.extend([0xb0, 0xb3])
         return out