From d82a3f8309a3892b07b8f11d6ff78e240c43ff33 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 2 Aug 2026 18:33:40 +0000 Subject: [PATCH] feat(host): expose MofeEngineHost.antennaDelays StateFlow for the mesh-health UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Item (2) of the UI/UX agent's data needs. The engine already computes the antenna delays (MultiObserverFusionEngine.antennaDelayCalibration(): AntennaDelayCalibrator .Result? — delays, residualRmsMeters, edgesUsed, ok), but a plain accessor is not reactive and isn't reachable from the UI layer. Add a StateFlow bridge refreshed on the same 2 s maintenance tick as anchorLinks: val antennaDelays: StateFlow androidApp only — a StateFlow bridge mirroring the anchorLinks pattern already on this branch; the referenced engine method + Result type are unchanged. Not compilable in this environment (Android Gradle plugin unavailable); for the UI/UX agent to compile on re-sync. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01WppuiKZt4CuQxX4N7k6SVR --- .../main/java/com/aether/mofe/platform/MofeEngineHost.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/androidApp/src/main/java/com/aether/mofe/platform/MofeEngineHost.kt b/androidApp/src/main/java/com/aether/mofe/platform/MofeEngineHost.kt index d7f15af..c6f58a6 100644 --- a/androidApp/src/main/java/com/aether/mofe/platform/MofeEngineHost.kt +++ b/androidApp/src/main/java/com/aether/mofe/platform/MofeEngineHost.kt @@ -1,6 +1,7 @@ package com.aether.mofe.platform import android.util.Log +import com.aether.mofe.engine.AntennaDelayCalibrator import com.aether.mofe.engine.CoordinateFrameManager import com.aether.mofe.engine.MofeBuilder import com.aether.mofe.engine.MofeListener @@ -116,6 +117,11 @@ class MofeEngineHost( * refreshed on the maintenance tick. A MISSING link is why the constellation won't fully solve. */ val anchorLinks: StateFlow = _anchorLinks.asStateFlow() + private val _antennaDelays = MutableStateFlow(null) + /** Latest antenna-delay calibration (per-device delays + residual RMS / edges used / ok) for + * the mesh-health UI, refreshed on the maintenance tick. null until a calibration exists. */ + val antennaDelays: StateFlow = _antennaDelays.asStateFlow() + /** Instrumentation + state capture — the engine's multi-observer fusion output, * surfaced to logcat AND to the flows above for the HUD/health pane to consume. */ private val logListener = object : MofeListener { @@ -222,6 +228,8 @@ class MofeEngineHost( // Refresh inter-anchor link health for the mesh-health UI (slow-changing). _anchorLinks.value = runCatching { eng.interAnchorLinkReport() } .getOrDefault(InterAnchorLinkReport.EMPTY) + // Latest antenna-delay calibration for the mesh-health UI. + _antennaDelays.value = runCatching { eng.antennaDelayCalibration() }.getOrNull() } } } -- 2.43.0