X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETCCSPI.py;h=0e2d787b1a216477cebb9fe8036f4940724fb43e;hp=0068e3ea94142107b2f4d4ae93dc4000a7a504fe;hb=0fdb361ae1af20139c5751a1b6151e5e065a31b3;hpb=763022cfff087e3a0123f5e6646521d065f5ad91 diff --git a/client/GoodFETCCSPI.py b/client/GoodFETCCSPI.py index 0068e3e..0e2d787 100644 --- a/client/GoodFETCCSPI.py +++ b/client/GoodFETCCSPI.py @@ -89,7 +89,8 @@ class GoodFETCCSPI(GoodFET): reg, val, self.peek(reg,bytes)); - return; + return False; + return True; def status(self): """Read the status byte.""" @@ -135,8 +136,8 @@ class GoodFETCCSPI(GoodFET): fsctrl=0x8000; #self.peek(0x18)&(~0x3FF); fsctrl=fsctrl+int(mhz-2048) self.poke(0x18,fsctrl); - self.strobe(0x02);//SCAL - self.strobe(0x03);//SRXON + self.strobe(0x02);#SCAL + self.strobe(0x03);#SRXON def RF_getfreq(self): """Get the frequency in Hz.""" fsctrl=self.peek(0x18); @@ -188,9 +189,10 @@ class GoodFETCCSPI(GoodFET): #self.strobe(0x09); return; - def RF_reflexjam(self): + def RF_reflexjam(self,duration=0): """Place the device into reflexive jamming mode.""" - data = ""; + data = [duration&0xff, + (duration>>8)&0xff]; self.writecmd(self.CCSPIAPP,0xA0,len(data),data); return; @@ -199,7 +201,7 @@ class GoodFETCCSPI(GoodFET): and that also sends a forged ACK if needed.""" data = ""; self.writecmd(self.CCSPIAPP,0xA1,len(data),data); - time.sleep(30); + print "Got:", data, "and", self.data return; def RF_modulated_spectrum(self):