+if(sys.argv[1]=="explore"):
+ #client.poke(0x00,0x00); #Stop nRF
+ client.poke(0x07,0x78); #Reset status register
+
+ #Power radio, prime for RX, no checksum.
+ client.poke(0x00,0x70|0x03);
+
+ #Set packet length of 32.
+ #Without checksums, extra data will mix in.
+ client.RF_setpacketlen(32);
+ client.RF_setmaclen(3); # shortest address length
+
+ #Now we're ready to get packets.
+ for smac in [0x0102030201, 0]:
+ client.RF_setsmac(smac);
+ for chan in range(0,0x80):
+ client.RF_setfreq((2400+chan) * 10**6);
+ time.sleep(1);
+ packet=client.RF_rxpacket();
+ if packet!=None:
+ print "Listening as %010x on %i MHz" % (client.RF_getsmac(),
+ client.RF_getfreq()/10**6);
+ printpacket(packet);
+ sys.stdout.flush();