fix: position packet `want_response` handling

Process valid position broadcasts with `want_response` true except from position requests with an empty payload (latitude and longitude are zeroes).
pull/1110/head
andrekir 2024-10-14 18:26:59 -03:00
rodzic eacf3a87a0
commit af56fff216
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -678,10 +678,13 @@ class MeshService : Service(), Logging {
// Handle new style position info
Portnums.PortNum.POSITION_APP_VALUE -> {
if (data.wantResponse) return // ignore data from position requests
val u = MeshProtos.Position.parseFrom(data.payload)
// debug("position_app ${packet.from} ${u.toOneLineString()}")
handleReceivedPosition(packet.from, u, dataPacket.time)
if (data.wantResponse && u.latitudeI == 0 && u.longitudeI == 0) {
debug("Ignoring nop position update from position request")
} else {
handleReceivedPosition(packet.from, u, dataPacket.time)
}
}
// Handle new style user info