more work on ccspi reflexive jam with autoack. jamming is slow in the autoack mode...
[goodfet] / client / GoodFETCCSPI.py
index 0283d87..1c14f85 100644 (file)
@@ -188,10 +188,18 @@ class GoodFETCCSPI(GoodFET):
     
     def RF_reflexjam(self):
         """Place the device into reflexive jamming mode."""
-        data = ""
+        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."""
         # print "Don't know how to hold a carrier.";
@@ -269,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."""