fuck you too
This commit is contained in:
@@ -196,18 +196,24 @@ def send_rds_data(tef: TEF6686, conn: socket.socket, state: dict):
|
|||||||
if (status & (1 << 9) == 0) or (status & (1 << 15) == 0) or (status & (1 << 13) == (1 << 13)): return
|
if (status & (1 << 9) == 0) or (status & (1 << 15) == 0) or (status & (1 << 13) == (1 << 13)): return
|
||||||
|
|
||||||
data = b""
|
data = b""
|
||||||
a_error = dec_error >> 6
|
if (status & (1 << 13) == 0):
|
||||||
c_error = (dec_error >> 2) & 0b11
|
err = 0
|
||||||
if (status & (1 << 12) == 0):
|
err |= ((dec_error >> 8) & 0x30) >> 4
|
||||||
# Type A, PI in A
|
err |= ((dec_error >> 8) & 0xC)
|
||||||
data = f"R{A:04X}{B:04X}{C:04X}".encode()
|
err |= ((dec_error >> 8) & 3) << 4
|
||||||
elif (status >> 12) & 1:
|
|
||||||
# Type B, PI in A and C
|
|
||||||
pi = A
|
|
||||||
if c_error < a_error: pi = C
|
|
||||||
data = f"R{pi:04X}{B:04X}{pi:04X}".encode()
|
|
||||||
data += f"{D:04X}{dec_error:02X}\n".encode()
|
|
||||||
|
|
||||||
|
data = b"R"
|
||||||
|
data += f"{B:04X}{C:04X}{D:04X}{err:02X}\n".encode()
|
||||||
|
|
||||||
|
pi_error = (dec_error >> 14) & 0b11
|
||||||
|
if pi_error < 3:
|
||||||
|
data += b"P" + f"{A:04X}".encode()
|
||||||
|
data += b"?" * pi_error + b"\n"
|
||||||
|
elif status & (1 << 12):
|
||||||
|
pi_error = (dec_error >> 10) & 0b11
|
||||||
|
if pi_error < 3:
|
||||||
|
data += b"P" + f"{C:04X}".encode()
|
||||||
|
data += b"?" * pi_error + b"\n"
|
||||||
if not data.strip(): return
|
if not data.strip(): return
|
||||||
conn.sendall(data)
|
conn.sendall(data)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user