Skip to content

Instantly share code, notes, and snippets.

@rkistner
Created May 13, 2012 19:41
Show Gist options
  • Save rkistner/cfb35603676929c02cb4 to your computer and use it in GitHub Desktop.
Save rkistner/cfb35603676929c02cb4 to your computer and use it in GitHub Desktop.
Fix for FR70
diff --git a/garmin.py b/garmin.py
index a4713b7..348f067 100644
--- a/garmin.py
+++ b/garmin.py
@@ -179,8 +179,12 @@ class Garmin(EasyAnt):
#print "burst data", self.state, data
if self.state == Garmin.State.REQUESTID:
- _logger.debug("%d, %d, %s", len(data), len(data[11:]), data[11:])
- (strlen, unitid, name) = struct.unpack("<BI14s", data[11:-2])
+ #_logger.debug("%d, %d, %s", len(data), len(data[11:]), data[11:])
+ _logger.debug("REQUESTID data: %s" % (data))
+ (strlen, unitid) = struct.unpack("<BI", data[11:16])
+ #name = data[16:(16+strlen)].tostring()
+ remaining = data[16:].tostring()
+ name = remaining.split('\0')[0]
print "String length: ", strlen
print "Unit ID: ", unitid
print "Product name: ", name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment