drop bad signal
This commit is contained in:
@@ -120,6 +120,7 @@ def process_command(tef: AutoFMAM, data: bytes, state: State, conn: socket.socke
|
|||||||
if freq < 153 or freq > 108000: continue
|
if freq < 153 or freq > 108000: continue
|
||||||
mode = TEF6686.TuneTo_Mode.FM_Jump
|
mode = TEF6686.TuneTo_Mode.FM_Jump
|
||||||
if tef.modulation == Modulation.AM: mode = TEF6686.TuneTo_Mode.Preset
|
if tef.modulation == Modulation.AM: mode = TEF6686.TuneTo_Mode.Preset
|
||||||
|
|
||||||
tef.set_modulation(freq)
|
tef.set_modulation(freq)
|
||||||
match tef.modulation:
|
match tef.modulation:
|
||||||
case Modulation.FM:
|
case Modulation.FM:
|
||||||
@@ -217,6 +218,8 @@ def send_signal_status(tef: AutoFMAM, conn: socket.socket, state: State):
|
|||||||
if ms_since_tune < 45: return # Give only "quality data"
|
if ms_since_tune < 45: return # Give only "quality data"
|
||||||
|
|
||||||
level = level / 10
|
level = level / 10
|
||||||
|
if level > 120: return
|
||||||
|
level += 11.25
|
||||||
|
|
||||||
data = b"S"
|
data = b"S"
|
||||||
|
|
||||||
@@ -234,7 +237,7 @@ def send_signal_status(tef: AutoFMAM, conn: socket.socket, state: State):
|
|||||||
state.last_bw_extend = False
|
state.last_bw_extend = False
|
||||||
else: data += b"M"
|
else: data += b"M"
|
||||||
|
|
||||||
conn.sendall(data + f"{level + 11.25},{wam//10},{usn//10},{bandwidth}\n\n".encode())
|
conn.sendall(data + f"{level},{wam//10},{usn//10},{bandwidth}\n\n".encode())
|
||||||
|
|
||||||
@periodic(RDS_UPDATE_INTERVAL)
|
@periodic(RDS_UPDATE_INTERVAL)
|
||||||
def send_rds_data(tef: AutoFMAM, conn: socket.socket, state: State):
|
def send_rds_data(tef: AutoFMAM, conn: socket.socket, state: State):
|
||||||
|
|||||||
Reference in New Issue
Block a user