X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETCCSPI.py;h=78273ac5774cabcd8b9e0db2b2e6b42731880c4b;hp=10e94bece1b50ca4da59bb8f681dbb448555081f;hb=443bcd972725a80fd8d55014d4f1d84485ec53f0;hpb=945e0c205122421188e9ee25c973b9236f2e4038 diff --git a/client/GoodFETCCSPI.py b/client/GoodFETCCSPI.py index 10e94be..78273ac 100644 --- a/client/GoodFETCCSPI.py +++ b/client/GoodFETCCSPI.py @@ -84,7 +84,7 @@ class GoodFETCCSPI(GoodFET): """Write a CCSPI Register.""" data=[reg,(val>>8)&0xFF,val&0xFF]; self.writecmd(self.CCSPIAPP,0x03,len(data),data); - if self.peek(reg,bytes)!=val: + if self.peek(reg,bytes)!=val and reg!=0x18: print "Warning, failed to set r%02x=0x%04x, got %02x." %( reg, val, @@ -186,6 +186,24 @@ class GoodFETCCSPI(GoodFET): #self.strobe(0x09); return; + def RF_reflexjam(self): + """Place the device into reflexive jamming mode.""" + data = ""; + self.writecmd(self.CCSPIAPP,0xA0,len(data),data); + return; + + def RF_reflexjam_seq(self): + """Place the device into reflexive jamming mode + and return the sequence number of the jammed packet.""" + #TODO make so that this function someone keeps receiving + # the sequence numbers from each jammed frame, or probably + # just make the firmware auto-ack if the frame requests + # an ACK instead of sending data back to client. + data = "\0"; + self.data = data; + self.writecmd(self.CCSPIAPP,0xA1,len(data),data); + buffer = self.data; + return ord(buffer[3]); def RF_modulated_spectrum(self): """Hold a carrier wave on the present frequency.""" @@ -258,8 +276,7 @@ class GoodFETCCSPI(GoodFET): return; def RF_autocrc(self,autocrc=1): mdmctrl0=self.peek(0x11); - return; - if autocrc==1: + if autocrc==0: mdmctrl0=mdmctrl0&(~0x0020); else: mdmctrl0=mdmctrl0|0x0020; @@ -295,6 +312,7 @@ class GoodFETCCSPI(GoodFET): for foo in packet: s="%s %02x" % (s,ord(foo)); print "#%s" % s; + def printdissect(self,packet): try: from scapy.all import Dot15d4