From: travisutk Date: Mon, 21 Feb 2011 05:15:53 +0000 (+0000) Subject: Reliable sniffing of 802.15.4 on the TelosB. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=73a31780aab1bea70e6e201dad4c752a3e253536 Reliable sniffing of 802.15.4 on the TelosB. No missed packets this time. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@932 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/client/GoodFETCCSPI.py b/client/GoodFETCCSPI.py index 1d27c24..612ce3e 100644 --- a/client/GoodFETCCSPI.py +++ b/client/GoodFETCCSPI.py @@ -141,7 +141,7 @@ class GoodFETCCSPI(GoodFET): """ # TODO -- Flush only if there's an overflow. - self.strobe(0x08); #SFLUSHRX + #self.strobe(0x08); #SFLUSHRX data="\0"; self.data=data; diff --git a/firmware/apps/radios/ccspi.c b/firmware/apps/radios/ccspi.c index ec0e207..5a3d5d6 100644 --- a/firmware/apps/radios/ccspi.c +++ b/firmware/apps/radios/ccspi.c @@ -140,23 +140,34 @@ void ccspi_handle_fn( uint8_t const app, break; case CCSPI_RX: #ifdef FIFOP - //Wait for any incoming packet to finish. - //while(!SFD); - while(SFD); - delay(1000); + //Has there been an overflow? + if((!FIFO)&&FIFOP){ + debugstr("Clearing overflow"); + CLRSS; + ccspitrans8(0x08); //SFLUSHRX + SETSS; + } //Is there a packet? - if((!SFD) && FIFOP){ // &&FIFOP to do address verification. + if(FIFOP&&FIFO){ + //Wait for completion. + while(SFD); + //Get the packet. CLRSS; - //ccspitrans8(CCSPI_RXFIFO); - ccspitrans8(0x3F|0x40); - cmddata[1]=0xff; //to be replaced with length - for(i=0;i