def RF_txpacket(self,packet):
"""Send a packet through the radio."""
self.writecmd(self.CCSPIAPP,0x81,len(packet),packet);
- time.sleep(1);
- self.strobe(0x09);
+ #time.sleep(1);
+ #self.strobe(0x09);
return;
def RF_carrier(self):
client.RF_getsmac(),
client.RF_getfreq()/10**6);
+
while 1:
client.RF_txpacket([0x0f, 0x01, 0x08, 0x82,
0xff, 0xff, 0xff, 0xff,
- 0x4d, 0x7d, 0x09, 0x00,
- 0x1f, 0x00, 0xc0]);
- print client.status();
- print;
+ 0xde, 0xad, 0xbe, 0xef,
+ 0xba, 0xbe, 0xc0]);
if(sys.argv[1]=="peek"):
start=0x0000;
case CCSPI_TX:
#ifdef FIFOP
- /* //Has there been an overflow?
- if(ccspi_status()&BIT5){
- debugstr("Clearing underflow");
- CLRSS;
- ccspitrans8(0x09); //SFLUSHTX
- SETSS;
- }
- */
-
-
//Wait for last packet to TX.
//while(ccspi_status()&BIT3);
ccspitrans8(0x04); //STXON
SETSS;
+ //Wait for the pulse on SFD, after which the packet has been sent.
+ while(!SFD);
+ while(SFD);
+
+ //Flush TX buffer.
+ CLRSS;
+ ccspitrans8(0x09); //SFLUSHTX
+ SETSS;
txdata(app,verb,0);
#else