X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETCCSPI.py;h=c056cf304a517d8382ca16bf4e04182c97e21e82;hp=8a216b3fe57d23ba1a4a65890d7a43be3a809735;hb=07652639a8256048cfdc4e63f79bb4e3f79dc768;hpb=d2d2799e450a28b1214aa2c6ccb4d065196c0911 diff --git a/client/GoodFETCCSPI.py b/client/GoodFETCCSPI.py index 8a216b3..c056cf3 100644 --- a/client/GoodFETCCSPI.py +++ b/client/GoodFETCCSPI.py @@ -5,7 +5,7 @@ # # This code is being rewritten and refactored. You've been warned! -import sys, time, string, cStringIO, struct, glob, serial, os; +import sys, time, string, cStringIO, struct, glob, os; from GoodFET import GoodFET; @@ -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.""" @@ -264,6 +277,14 @@ class GoodFETCCSPI(GoodFET): 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."""