Skip to content

Commit

Permalink
fix: position packet want_response handling
Browse files Browse the repository at this point in the history
Process valid position broadcasts with `want_response` true except from position requests with an empty payload (latitude and longitude are zeroes).
  • Loading branch information
andrekir committed Oct 14, 2024
1 parent eacf3a8 commit af56fff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/src/main/java/com/geeksville/mesh/service/MeshService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit af56fff

Please sign in to comment.