mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00: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:
parent
86e4d1b1da
commit
23db9f2443
1 changed files with 4 additions and 0 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue