From 2273a025705f41e3c8f813c2b14a24edb7924869 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 29 May 2015 12:00:33 +0200 Subject: Show TII Vectors --- dab752.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dab752.py b/dab752.py index 09a91a9..46df6e8 100644 --- a/dab752.py +++ b/dab752.py @@ -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: -- cgit v1.2.3