CC2420 autocrc.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 24 Feb 2011 02:34:56 +0000 (02:34 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 24 Feb 2011 02:34:56 +0000 (02:34 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@952 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFETCCSPI.py
client/goodfet.ccspi

index 394c7f6..10e94be 100644 (file)
@@ -256,7 +256,15 @@ class GoodFETCCSPI(GoodFET):
             mdmctrl0=mdmctrl0|0x800;
         self.poke(0x11,mdmctrl0);
         return;
             mdmctrl0=mdmctrl0|0x800;
         self.poke(0x11,mdmctrl0);
         return;
-        
+    def RF_autocrc(self,autocrc=1):
+        mdmctrl0=self.peek(0x11);
+        return;
+        if autocrc==1:
+            mdmctrl0=mdmctrl0&(~0x0020);
+        else:
+            mdmctrl0=mdmctrl0|0x0020;
+        self.poke(0x11,mdmctrl0);
+        return;
     packetlen=16;
     def RF_setpacketlen(self,len=16):
         """Set the number of bytes in the expected payload."""
     packetlen=16;
     def RF_setpacketlen(self,len=16):
         """Set the number of bytes in the expected payload."""
index d361285..d63ea4c 100755 (executable)
@@ -92,6 +92,7 @@ if(sys.argv[1]=="rssi"):
 if(sys.argv[1]=="sniff" or sys.argv[1]=="sniffdissect"):
     #Promiscuous mode.
     client.RF_promiscuity(1);
 if(sys.argv[1]=="sniff" or sys.argv[1]=="sniffdissect"):
     #Promiscuous mode.
     client.RF_promiscuity(1);
+    client.RF_autocrc(0);
     
     if len(sys.argv)>2:
         freq=eval(sys.argv[2]);
     
     if len(sys.argv)>2:
         freq=eval(sys.argv[2]);
@@ -116,6 +117,7 @@ if(sys.argv[1]=="bsniff"):
     #Just broadcast.
     client.RF_promiscuity(0);
     client.RF_setsmac(0xFFFFFFFF);
     #Just broadcast.
     client.RF_promiscuity(0);
     client.RF_setsmac(0xFFFFFFFF);
+    client.RF_autocrc(1);
     
     if len(sys.argv)>2:
         freq=eval(sys.argv[2]);
     
     if len(sys.argv)>2:
         freq=eval(sys.argv[2]);