X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETMCPCANCommunication.py;h=58fa57711ca761c8887a83fe2e0c60dbf4e9ee98;hp=40983c2b643e0f9cf297550070543eb30e12ae03;hb=63305a1bde764ca61d315bc4620a3aa7a8f4cfc0;hpb=8e9568074076cd86c2058d41065bba4e7f9bb2e0 diff --git a/client/GoodFETMCPCANCommunication.py b/client/GoodFETMCPCANCommunication.py index 40983c2..58fa577 100644 --- a/client/GoodFETMCPCANCommunication.py +++ b/client/GoodFETMCPCANCommunication.py @@ -157,7 +157,9 @@ class GoodFETMCPCANCommunication: #add the data to list if the pointer was included if(data != None and packet != None): #data.append(self.client.packet2parsedstr(packet)) - data.put(self.client.packet2parsed(packet)) + packetParsed = self.client.packet2parsed(packet) + packetParsed["time"] =time.time() + data.put(packetParsed) if(debug == True): #check packet status MCPstatusReg = self.client.MCPrxstatus(); @@ -554,7 +556,7 @@ class GoodFETMCPCANCommunication: self.spitSetup(freq); spit(self,freq, standardid, repeat, duration = None, debug = False, packet = None) - def spit(self,freq, standardid, repeat, duration = None, debug = False, packet = None): + def spit(self,freq, standardid, repeat,writes, period = None, debug = False, packet = None): #### split SID into different regs @@ -597,19 +599,22 @@ class GoodFETMCPCANCommunication: print "Transmitting packet: " - print self.client.packet2str(packet) + #print self.client.packet2str(packet) self.client.txpacket(packet); if repeat: print "\nNow looping on transmit. " if duration!= None: - starttime = time.time(); - while((time.time()-starttime < duration)): + for i in range(0,trials): self.client.MCPrts(TXB0=True); - print "MSG printed" + time.sleep(period/1000) # pause for period ms before sending again + #starttime = time.time(); + #while((time.time()-starttime < duration)): + # self.client.MCPrts(TXB0=True); + # print "MSG printed" else: - while(1): + for i in range(0,trials): self.client.MCPrts(TXB0=True); print "messages injected"