+ #time.sleep(1);
+ packet=client.RF_rxpacket();
+ #print ".";
+ printmspacket(packet);
+ sys.stdout.flush();
+
+if(sys.argv[1]=="sniffant"):
+ #Prototyped on Garmin device.
+ #Channel hopping is pretty damned fast, hard to follow.
+ #This doesn't really work yet, still experimenting.
+
+ #Might be more effective to sniff knowing the MFG ID and Dev. ID,
+ #as these predict a lot of the MAC address.
+
+ client.poke(0x00,0x00); #Stop nRF
+ client.poke(0x01,0x00); #Disable Shockburst
+ client.poke(0x02,0x01); #Set RX Pipe 0
+
+ client.poke(0x05,57); #broadcast-only channel
+ client.poke(0x06,0x00); #1MBps
+ client.poke(0x07,0x78); #Reset status register
+
+ #Is this appropriate? Might be 3.
+ client.RF_setmaclen(5);
+
+
+ #Mac packet length, illegally 0-length address field.
+ client.RF_setpacketlen(16);
+
+ if len(sys.argv)>2:
+ client.tune(sys.argv[2]);
+ else:
+
+ print "Searching for ANT+.";
+
+ guesser=AutoTuner();
+ guesser.init(client, rate=False, sync=True, chan=True);
+ guesser.selftune(threshold=2,forever=False,
+ delay=9.0);
+
+ client.poke(0x00,0x00); #Stop nRF
+ client.poke(0x01,0x00); #Disable Shockburst
+ client.poke(0x02,0x01); #Set RX Pipe 0
+ client.RF_setmaclen(5);
+
+
+ client.poke(0x00,0x70|0x03); #prime radio.
+ print "Dumping ANT as %010x on %i MHz" % (client.RF_getsmac(),
+ client.RF_getfreq()/10**6);
+ #Now we're ready to get packets.
+ while 1:
+ packet=None;
+ while packet==None:
+ #time.sleep(1);