def status(self):
"""Read the status byte."""
+ statusbits={0x80: "?",
+ 0x40: "XOSC16M_STABLE",
+ 0x20: "TX_UNDERFLOW",
+ 0x10: "ENC_BUSY",
+ 0x08: "TX_ACTIVE",
+ 0x04: "LOCK",
+ 0x02: "RSSI_VALID",
+ 0x01: "?"};
status=self.strobe(0x00);
- print "Status=%02x" % status;
+ i=1;
+ str="";
+ while i<0x100:
+ if status&i:
+ str="%s %s" % (statusbits[i],str);
+ i*=2;
+ return str;
#Radio stuff begins here.
def RF_setenc(self,code="802.15.4"):
#Might read as all ones if chip has a startup delay.
if(sys.argv[1]=="info"):
- print "Found %s" % client.identstr();
- print "Freq: %05.05f MHz" % (client.RF_getfreq()/(10**6));
+ print "Found %s" % client.identstr();
+ print "Freq: %05f MHz" % (client.RF_getfreq()/(10**6));
+ print "Status: %s" % client.status();
if(sys.argv[1]=="regs"):
for adr in range(0x10,0x40): #*1024):
val=client.peek(adr);