mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
cleanup lastHeard in node info (instead of position.time)
This commit is contained in:
parent
3be55f8c7f
commit
3c457a118d
5 changed files with 13 additions and 21 deletions
|
|
@ -831,7 +831,6 @@ class MeshService : Service(), Logging {
|
|||
updateNodeInfo(fromNum) {
|
||||
debug("update ${it.user?.longName} with ${p.toOneLineString()}")
|
||||
it.position = Position(p)
|
||||
updateNodeInfoTime(it, (defaultTime / 1000).toInt())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -916,7 +915,7 @@ class MeshService : Service(), Logging {
|
|||
// through our node on the way to the phone that means that local node is also alive in the mesh
|
||||
|
||||
updateNodeInfo(myNodeNum) {
|
||||
it.position = it.position?.copy(time = currentSecond())
|
||||
it.lastHeard = currentSecond()
|
||||
}
|
||||
|
||||
// if (p.hasPosition()) handleReceivedPosition(fromNum, p.position, rxTime)
|
||||
|
|
@ -959,8 +958,8 @@ class MeshService : Service(), Logging {
|
|||
if (!mi.hasGPS) {
|
||||
var broadcastSecs = prefs.positionBroadcastSecs
|
||||
|
||||
desiredInterval = if(broadcastSecs == 0) // unset by device, use default
|
||||
15 * 60 * 1000
|
||||
desiredInterval = if (broadcastSecs == 0) // unset by device, use default
|
||||
15 * 60 * 1000
|
||||
else
|
||||
broadcastSecs * 1000L
|
||||
}
|
||||
|
|
@ -1821,6 +1820,5 @@ class MeshService : Service(), Logging {
|
|||
}
|
||||
|
||||
fun updateNodeInfoTime(it: NodeInfo, rxTime: Int) {
|
||||
if (it.position?.time == null || it.position?.time!! < rxTime)
|
||||
it.position = it.position?.copy(time = rxTime)
|
||||
it.lastHeard = rxTime
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue