mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-29 11:13:41 -04:00
fix: Add delays around heartbeat on connection (#3643)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user