diff options
-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: |