+if(sys.argv[1]=="specan"):
+ print "This doesn't work yet."
+
+ client.CC1110_crystal();
+ client.RF_idle();
+
+ client.config_simpliciti();
+
+ if len(sys.argv)>2:
+ client.RF_setfreq(eval(sys.argv[2]));
+ #print "Listening on %f MHz." % (client.RF_getfreq()/10.0**6);
+
+ client.CChaltcpu();
+ client.shellcodefile("specan.ihx",wait=0);
+ #client.shellcodefile("crystal.ihx",wait=1);
+
+ bytestart=0xf800;
+ maxchan=10;
+ round=0;
+
+ print "time freq rssi";
+
+ while 1:
+ time.sleep(1);
+ #client.CChaltcpu();
+
+ round=round+1;
+
+ dump="";
+ for entry in range(0,maxchan):
+ adr=bytestart+entry*8;
+ freq=((client.CCpeekdatabyte(adr+0)<<16)+
+ (client.CCpeekdatabyte(adr+1)<<8)+
+ (client.CCpeekdatabyte(adr+2)<<0));
+ hz=freq*396.728515625;
+ mhz=hz/1000000.0
+ rssi=client.CCpeekdatabyte(adr+6);
+ print "%03i %3.3f %03i" % (round,mhz,rssi);
+ print dump;
+ sys.stdout.flush();
+ client.CCreleasecpu();
+