mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
add EnvironmentMetrics to NodeInfo
This commit is contained in:
parent
75af1ed197
commit
d2140b13cb
2 changed files with 40 additions and 4 deletions
|
|
@ -815,13 +815,17 @@ class MeshService : Service(), Logging {
|
|||
/// Update our DB of users based on someone sending out a Telemetry subpacket
|
||||
private fun handleReceivedTelemetry(
|
||||
fromNum: Int,
|
||||
p: TelemetryProtos.Telemetry,
|
||||
t: TelemetryProtos.Telemetry,
|
||||
defaultTime: Long = System.currentTimeMillis()
|
||||
) {
|
||||
updateNodeInfo(fromNum) {
|
||||
it.deviceMetrics = DeviceMetrics(
|
||||
p.deviceMetrics,
|
||||
if (p.time != 0) p.time else (defaultTime / 1000L).toInt()
|
||||
t.deviceMetrics,
|
||||
if (t.time != 0) t.time else (defaultTime / 1000L).toInt()
|
||||
)
|
||||
it.environmentMetrics = EnvironmentMetrics(
|
||||
t.environmentMetrics,
|
||||
if (t.time != 0) t.time else (defaultTime / 1000L).toInt()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue