mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-12 00:28:20 -04:00
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>
This commit is contained in:
@@ -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() }
|
||||
|
||||
Reference in New Issue
Block a user