X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=client%2FGoodFETCCSPI.py;h=43001b815939910be71721e856370cb0a9166435;hb=669001fc7d824a0e25eba41869b4b0b66c980ee0;hp=c056cf304a517d8382ca16bf4e04182c97e21e82;hpb=37e18da03e554d588a08b3f654ac611cb7debada;p=goodfet diff --git a/client/GoodFETCCSPI.py b/client/GoodFETCCSPI.py index c056cf3..43001b8 100644 --- a/client/GoodFETCCSPI.py +++ b/client/GoodFETCCSPI.py @@ -135,13 +135,15 @@ class GoodFETCCSPI(GoodFET): fsctrl=0x8000; #self.peek(0x18)&(~0x3FF); fsctrl=fsctrl+int(mhz-2048) self.poke(0x18,fsctrl); - self.strobe(0x02); + self.strobe(0x02);#SCAL + self.strobe(0x03);#SRXON def RF_getfreq(self): """Get the frequency in Hz.""" fsctrl=self.peek(0x18); mhz=2048+(fsctrl&0x3ff) return mhz*1000000; def RF_setchan(self,channel): + """Set the ZigBee/802.15.4 channel number.""" if channel < 11 or channel > 26: print "Only 802.15.4 channels 11 to 26 are currently supported."; else: @@ -186,9 +188,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;