Merge branch 'meshtastic:master' into osmdroid-phase2

pull/489/head^2
PWRxPSYCHO 2022-10-07 20:58:24 -04:00 zatwierdzone przez GitHub
commit c0a2651e47
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -167,10 +167,9 @@ class MeshService : Service(), Logging {
location.latitude,
location.longitude,
location.altitude.toInt(),
myNodeNum, // we just send to the local node
(location.time / 1000).toInt(),
)
}
.launchIn(CoroutineScope(Dispatchers.Default))
}.launchIn(CoroutineScope(Dispatchers.Default))
}
}
@ -1429,19 +1428,20 @@ class MeshService : Service(), Logging {
lat: Double = 0.0,
lon: Double = 0.0,
alt: Int = 0,
destNum: Int = DataPacket.NODENUM_BROADCAST,
time: Int = currentSecond(),
) {
try {
val mi = myNodeInfo
if (mi != null) {
debug("Sending our position/time to=$destNum lat=${lat.anonymize}, lon=${lon.anonymize}, alt=$alt")
val destNum = mi.myNodeNum // we just send to the local node
debug("Sending our position/time to=$destNum lat=${lat.anonymize}, lon=${lon.anonymize}, alt=$alt, time=$time")
val position = MeshProtos.Position.newBuilder().also {
it.longitudeI = Position.degI(lon)
it.latitudeI = Position.degI(lat)
it.altitude = alt
it.time = currentSecond() // Include our current timestamp
it.time = time
}.build()
// Also update our own map for our nodenum, by handling the packet just like packets from other users