diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-05-29 12:00:33 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-05-29 12:00:33 +0200 |
commit | 2273a025705f41e3c8f813c2b14a24edb7924869 (patch) | |
tree | f0e8c962f556093579fc8e9d428200853503494f /dab752.py | |
parent | 5e480f068217e7987838db10c7a9f86893c7d8ee (diff) | |
download | dab752-remote-2273a025705f41e3c8f813c2b14a24edb7924869.tar.gz dab752-remote-2273a025705f41e3c8f813c2b14a24edb7924869.tar.bz2 dab752-remote-2273a025705f41e3c8f813c2b14a24edb7924869.zip |
Show TII Vectors
Diffstat (limited to 'dab752.py')
-rw-r--r-- | dab752.py | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -195,12 +195,33 @@ print() print("Subscribe to TII info") llcp.transmit([SetSubscription, TIIListChanged, 1]) +llcp.transmit([SetSubscription, TIIVectorsChanged, 1]) print() while True: try: packet = llcp.receive_packet() if packet: + if packet[3] == TIIVectorsChanged: + if packet[4] == 3: + print("TII Vectors: no valid data") + elif packet[4] == 0: + print("TII Vectors") + nroftii = packet[5] + ix = 6 + for i in range(nroftii): + real_part = packet[ix+2] + if real_part > 127: + real_part = real_part - 256 + imag_part = packet[ix+3] + print(packet[ix+2]) + if imag_part > 127: + imag_part = imag_part - 256 + print(" comb=%d, pattern=%d, %d + %d j" % (packet[ix], packet[ix+1], real_part, imag_part)) + ix += 4 + else: + print("TII Vectors: invalid packet") + if packet[3] == TIIListChanged: if packet[4] == 3: print("TII List: no valid data") @@ -211,7 +232,6 @@ while True: for i in range(nroftii): print(" comb=%d, pattern=%d" % (packet[ix], packet[ix+1])) ix += 2 - else: print("TII List: invalid packet") else: |