-
-
Save rkistner/cfb35603676929c02cb4 to your computer and use it in GitHub Desktop.
Fix for FR70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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