]> git.zndr.dk Git - dotfiles.git/commitdiff
Minor update
authorJannik Zander <jannikz@gmail.com>
Thu, 9 Jun 2016 22:20:03 +0000 (00:20 +0200)
committerJannik Zander <jannikz@gmail.com>
Thu, 9 Jun 2016 22:20:03 +0000 (00:20 +0200)
.local/bin/gf.py

index 59a424d69ab54e66558795006d753ecab28d1c27..44090afa18ccdf2e006757688e17d28ce2d228dd 100755 (executable)
@@ -88,7 +88,6 @@ def process(line):
   global t
   global speed
   global master
-
   # Some extra info from logging tool
   isok=process_isok(line)
   timestamp=process_timestamp(line)
@@ -96,19 +95,22 @@ def process(line):
     timezero=timestamp
   # Process received data
   typ,ds,le,da,sa,line=process_head(line)
+  numbytes=le-2
   if da==0xF7:
-    numbytes=le-2
     while numbytes>0:
       cl,os,ale,line=process_apdu(line)
-      numbytes=numbytes-2-ale
+      numbytes=numbytes-2
       if cl==5:
         id,val,line=process_class5(line,int(ale/2))
+        numbytes=numbytes-ale
+        # Debugging info....
         t=t+[timestamp-timezero]
         master=master+[1+(sa-31)/10]
         for i in range(4):
           speed[i]=speed[i]+[val[i]/254]
       else:
         line=line[ale*3:]
+        numbytes=numbytes-ale
     crc=process_crc(line)
   return