X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FFordExperiments.py;h=326cf2ebd2dead3faf15883ce6a25e29fd53d3b7;hp=2baf55133cd6751e49fb8deaba3afbb7eba930fc;hb=e69fa827ffcc6d978d9cf6b4ce967327e276d224;hpb=d08bfd3c7cdc687fd68ba9025702c262665e52d3 diff --git a/client/FordExperiments.py b/client/FordExperiments.py index 2baf551..326cf2e 100644 --- a/client/FordExperiments.py +++ b/client/FordExperiments.py @@ -14,14 +14,15 @@ import math tT = time class FordExperiments(GoodFETMCPCANCommunication): - def init(self): - super(FordExperimetns,self).__init__(self) #initialize chip + def __init__(self): + GoodFETMCPCANCommunication.__init__(self) + #super(FordExperiments,self).__init__(self) #initialize chip self.freq = 500; def mimic1056(self,packetData,runTime): #setup chip self.client.serInit() - self.spitSetup(500) + self.spitSetup(self.freq) #FIGURE out how to clear buffers self.addFilter([1056, 1056, 1056, 1056,1056, 1056], verbose=False) packet1 = self.client.rxpacket(); @@ -141,6 +142,25 @@ class FordExperiments(GoodFETMCPCANCommunication): #recieveTime = time.time() return packetParsed + + def cycle4packets1279(self): + self.client.serInit() + self.spitSetup(500) + # filter on 1279 + self.addFilter([1279, 1279, 1279, 1279, 1279, 1279], verbose = False) + packetParsed = self.getBackground(1279) + packet = [] + if (packetParsed[db0] == 16): + # if it's the first of the four packets, replace the value in db7 with 83 + packetParsed[db7] = 83 + # transmit new packet + self.client.txpacket(packetParsed) + else: + # otherwise, leave it alone + # transmit same pakcet we read in + self.client.txpacket(packetParsed) + # print the packet we are transmitting + print packetParsed def oscillateTemperature(self,time):