mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-08-11 03:12:51 +02:00
fix(repeater): wire the flood reception delay base into the dispatcher
The delays.rx_delay_base config value was stored and reported but never applied. Now that the core dispatcher implements MeshCore's flood reception-quality delay, feed it through: - set dispatcher.rx_delay_base from delays.rx_delay_base at startup and re-apply it on live config updates of the delays section (web API saves already pass that section) - point the mesh CLI get/set rxdelay at the delays section; it read and wrote repeater.rx_delay_base, which nothing consumes, so the CLI knob was silently dead - delegate RepeaterHandler.calculate_packet_score to the shared core packet_score (same firmware packetScoreInt formula, one impl) Suppression works through the existing engine seen-cache because it dedupes at process time, after the dispatcher hold. Default remains 0 (delay disabled), matching firmware.
This commit is contained in:
@@ -570,7 +570,9 @@ class MeshCLI:
|
||||
return f"> {loop_detect}"
|
||||
|
||||
elif param == "rxdelay":
|
||||
delay = self.repeater_config.get("rx_delay_base", 0.0)
|
||||
# The flood RX delay base lives in the delays section (the value
|
||||
# the dispatcher and web API use), not the repeater section.
|
||||
delay = self.config.get("delays", {}).get("rx_delay_base", 0.0)
|
||||
return f"> {delay}"
|
||||
|
||||
elif param == "txdelay":
|
||||
@@ -741,7 +743,7 @@ class MeshCLI:
|
||||
delay = float(value)
|
||||
if delay < 0:
|
||||
return "Error: cannot be negative"
|
||||
self.repeater_config["rx_delay_base"] = delay
|
||||
self.config.setdefault("delays", {})["rx_delay_base"] = delay
|
||||
saved, _ = self.config_manager.save_to_file()
|
||||
self.config_manager.live_update_daemon(["repeater", "delays"])
|
||||
return "OK"
|
||||
|
||||
Reference in New Issue
Block a user