added display to the mainDisplay that shows packets streaming
[goodfet] / client / GoodFETMCPCAN.py
index c740003..f003e01 100644 (file)
@@ -297,11 +297,10 @@ class GoodFETMCPCAN(GoodFETSPI):
         dp2 = ord(data[1])
         dp5 = ord(data[4])
         
-        #converts the CAN message to a string
         msg="";
         
         
-        
+
         #get the ide bit. allows us to check to see if we have an extended
         #frame
         ide = (dp2 & 0x0f)>>3
@@ -327,9 +326,13 @@ class GoodFETMCPCAN(GoodFETSPI):
         #generate the data section
         dbmsg = ""
         for i in range(0,length):
-            dbmsg += data[idx]   
+            idx = 5 + i
+            dbmsg += " %03d"%ord(data[idx])   
         
-        msg = "sID: %04d" + eIDmsg + rtrmsg + ("length: %d"%(length)) + dbmsg 
+        msg = "sID: %04d"%sID
+        msg += eIDmsg + rtrmsg
+        msg += " length: %d"%(length)
+        msg +=  dbmsg 
     
         return msg
         
@@ -376,4 +379,4 @@ class GoodFETMCPCAN(GoodFETSPI):
 # TXRTSCTRL = x0D
 
 
-    
\ No newline at end of file
+