X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETMCPCANCommunication.py;h=676d018c9bc751818fff12e99d785f48bda88bba;hp=226366eb981585a73c805242ba8ca7e86eeb4e7f;hb=d08bfd3c7cdc687fd68ba9025702c262665e52d3;hpb=063169b97150bc63858a393f503273dbaa3489a5 diff --git a/client/GoodFETMCPCANCommunication.py b/client/GoodFETMCPCANCommunication.py index 226366e..676d018c9 100644 --- a/client/GoodFETMCPCANCommunication.py +++ b/client/GoodFETMCPCANCommunication.py @@ -556,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 @@ -599,19 +599,24 @@ 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)): + if period != None: + for i in range(0,writes): self.client.MCPrts(TXB0=True); - print "MSG printed" + tic = time.time() + time.sleep(period/1000) # pause for period ms before sending again + print time.time()-tic + #starttime = time.time(); + #while((time.time()-starttime < duration)): + # self.client.MCPrts(TXB0=True); + # print "MSG printed" else: - while(1): + for i in range(0,writes): self.client.MCPrts(TXB0=True); print "messages injected"