From 4340fc5045ffaf914c57cca698485408af1ca48b Mon Sep 17 00:00:00 2001 From: James Rich Date: Wed, 6 May 2026 14:15:01 -0500 Subject: [PATCH] feat: handle NODE_STATUS_APP packets to populate node status string Parse UTF-8 payload from NODE_STATUS_APP (PortNum=36) and update the node's nodeStatus field. Already displayed in NodeItem and NodeDetailsSection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../org/meshtastic/core/data/radio/SdkStateBridge.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/data/src/commonMain/kotlin/org/meshtastic/core/data/radio/SdkStateBridge.kt b/core/data/src/commonMain/kotlin/org/meshtastic/core/data/radio/SdkStateBridge.kt index 516303c1a..dde0c355c 100644 --- a/core/data/src/commonMain/kotlin/org/meshtastic/core/data/radio/SdkStateBridge.kt +++ b/core/data/src/commonMain/kotlin/org/meshtastic/core/data/radio/SdkStateBridge.kt @@ -164,6 +164,16 @@ class SdkStateBridge( } .launchIn(scope) + // ── NODE_STATUS_APP: update node status string ─────────────────────── + accessor.client + .flatMapLatest { client -> client?.packets ?: flowOf() } + .filter { it.decoded?.portnum == PortNum.NODE_STATUS_APP } + .onEach { packet -> + val status = packet.decoded?.payload?.utf8() ?: return@onEach + nodeRepository.updateNode(packet.from) { it.copy(nodeStatus = status) } + } + .launchIn(scope) + // ── Events (notifications, security, backpressure) ────────────────── accessor.client .flatMapLatest { client -> client?.events ?: flowOf() }