X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETCCSPI.py;h=1c14f85be7d1cabd0ab2039b26d123fe415d462f;hp=394c7f637f24d506bfddb2e918c70cfdc49760a5;hb=488bacac294141af99fbec482db6ca21b8019a5e;hpb=1f89a374af8020b2902b2a7b636fc05a18c6c16d diff --git a/client/GoodFETCCSPI.py b/client/GoodFETCCSPI.py index 394c7f6..1c14f85 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,19 @@ 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_autoack(self): + """Place the device into reflexive jamming mode + and that also sends a forged ACK if needed.""" + data = ""; + self.writecmd(self.CCSPIAPP,0xA1,len(data),data); + time.sleep(30); + return; def RF_modulated_spectrum(self): """Hold a carrier wave on the present frequency.""" @@ -256,7 +269,22 @@ class GoodFETCCSPI(GoodFET): mdmctrl0=mdmctrl0|0x800; self.poke(0x11,mdmctrl0); return; - + def RF_autocrc(self,autocrc=1): + mdmctrl0=self.peek(0x11); + if autocrc==0: + mdmctrl0=mdmctrl0&(~0x0020); + else: + mdmctrl0=mdmctrl0|0x0020; + self.poke(0x11,mdmctrl0); + return; + def RF_autoack(self,autoack=1): + mdmctrl0=self.peek(0x11); + if autoack==0: + mdmctrl0=mdmctrl0&(~0x0010); + else: + mdmctrl0=mdmctrl0|0x0010; + self.poke(0x11,mdmctrl0); + return; packetlen=16; def RF_setpacketlen(self,len=16): """Set the number of bytes in the expected payload.""" @@ -287,6 +315,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