aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-05-29 12:00:33 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-05-29 12:00:33 +0200
commit2273a025705f41e3c8f813c2b14a24edb7924869 (patch)
treef0e8c962f556093579fc8e9d428200853503494f
parent5e480f068217e7987838db10c7a9f86893c7d8ee (diff)
downloaddab752-remote-2273a025705f41e3c8f813c2b14a24edb7924869.tar.gz
dab752-remote-2273a025705f41e3c8f813c2b14a24edb7924869.tar.bz2
dab752-remote-2273a025705f41e3c8f813c2b14a24edb7924869.zip
Show TII Vectors
-rw-r--r--dab752.py22
1 files changed, 21 insertions, 1 deletions
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: