X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETCCSPI.py;h=1c14f85be7d1cabd0ab2039b26d123fe415d462f;hp=78273ac5774cabcd8b9e0db2b2e6b42731880c4b;hb=488bacac294141af99fbec482db6ca21b8019a5e;hpb=8811b9e7eb0c09f5b7568abc5cbe8de90104c38d diff --git a/client/GoodFETCCSPI.py b/client/GoodFETCCSPI.py index 78273ac..1c14f85 100644 --- a/client/GoodFETCCSPI.py +++ b/client/GoodFETCCSPI.py @@ -192,18 +192,13 @@ class GoodFETCCSPI(GoodFET): self.writecmd(self.CCSPIAPP,0xA0,len(data),data); return; - def RF_reflexjam_seq(self): + def RF_reflexjam_autoack(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; + and that also sends a forged ACK if needed.""" + data = ""; self.writecmd(self.CCSPIAPP,0xA1,len(data),data); - buffer = self.data; - return ord(buffer[3]); + time.sleep(30); + return; def RF_modulated_spectrum(self): """Hold a carrier wave on the present frequency.""" @@ -282,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."""