print "Standby: False" if int(b1[2:5],2) == 3: print "Phase Locking: True" else: print "Phase Locking: False" if int(b1[2:5],2) == 4: print "Operacional: True" else: print "Operacional: False" if int(b1[2:5],2) == 5: print "Manual: True" else: print "Manual: False" mgr = AmbManager('AOSTiming') while(1): try: (data,t) = mgr.monitor(3,0x38,0x01100) (b0,b1) = struct.unpack("!2B",data) lspp_print(decimal(b0),decimal(b1)) print "B0=%d B1=%d" % (b0,b1) print decimal(b0) print decimal(b1) time.sleep(1) except KeyboardInterrupt: break #
bin +=i a -= 1 return bin def check(bin): if bin == '0': return 'False' else: return 'True' def lspp_print(b0,b1): print "B1:" print "RF Input Ready: %s" % check(b1[0]) print "TuningInit Done: %s" % check(b1[4]) print "Locked: %s" % check(b1[7]) # print "B1:" # print "Phaselock State: %s" % check(b1[0]) mgr = AmbManager('AOSTiming') while(1): try: (data,t) = mgr.monitor(3,0x38,0x03020) (b0,b1) = struct.unpack("!2B",data) lspp_print(decimal(b0),decimal(b1)) print "B0=%d B1=%d" % (b0,b1) print decimal(b0) print decimal(b1) time.sleep(1) except KeyboardInterrupt: break #