added packet fuzzing
[goodfet] / client / GoodFETMCPCANCommunication.py
index 6af64ff..09519d2 100644 (file)
@@ -173,10 +173,11 @@ class GoodFETMCPCANCommunication:
                     print "Message in RXB0; message type is %02x (0x00 is standard data, 0x08 is standard remote)." %messagetype
                 elif(messagestat == 0x00):
                     print "No messages in buffers."
-            
+            #check to see if there was a packet
+            if( packet != None):
+                packetcount+=1;
             if (packet!=None and writeToFile == True):
                 
-                packetcount+=1;
                 row = [];
                 row.append("%f"%time.time());
                 
@@ -509,9 +510,9 @@ class GoodFETMCPCANCommunication:
             if period != None:
                 for i in range(0,writes):
                     self.client.MCPrts(TXB0=True);
-                    tic = time.time()
+                    #tic = time.time()
                     time.sleep(period/1000) # pause for period ms before sending again
-                    print time.time()-tic
+                    #print time.time()-tic
                 #starttime = time.time();
                 #while((time.time()-starttime < duration)):
                 #    self.client.MCPrts(TXB0=True);