From 23db9f244312552de452db412300dff24d0b2ab4 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Sun, 9 Nov 2025 09:50:36 -0600 Subject: [PATCH] fix: Add delays around heartbeat on connection (#3643) Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> --- app/src/main/java/com/geeksville/mesh/service/MeshService.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt index 300fb71f8..d7e3694dc 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -208,6 +208,8 @@ class MeshService : Service() { // Two-stage config flow nonces to avoid stale BLE packets, mirroring Meshtastic-Apple private const val DEFAULT_CONFIG_ONLY_NONCE = 69420 private const val DEFAULT_NODE_INFO_NONCE = 69421 + + private const val HEARTBEAT_INTERVAL = 25L } private val serviceJob = Job() @@ -1779,7 +1781,9 @@ class MeshService : Service() { } // Keep BLE awake and allow the firmware to settle before the node-info stage. serviceScope.handledLaunch { + delay(HEARTBEAT_INTERVAL) sendHeartbeat() + delay(HEARTBEAT_INTERVAL) startNodeInfoOnly() } }