From acd43b29f5702a1dcbc8f2778e14c9c5f7b74611 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Mon, 15 Feb 2021 09:48:44 +0800 Subject: [PATCH] don't (incorrectly) set want_replies --- .../mesh/service/MeshServiceLocationCallback.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshServiceLocationCallback.kt b/app/src/main/java/com/geeksville/mesh/service/MeshServiceLocationCallback.kt index 4733557e0..b0bc2e857 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshServiceLocationCallback.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshServiceLocationCallback.kt @@ -37,9 +37,13 @@ class MeshServiceLocationCallback( locationResult.lastLocationOrBestEffort()?.let { location -> MeshService.info("got phone location") if (location.isAccurateForMesh) { // if within 200 meters, or accuracy is unknown - val shouldSend = isAllowedToSend() - val destinationNumber = if (shouldSend) DataPacket.NODENUM_BROADCAST else getNodeNum() - sendPosition(location, destinationNumber, wantResponse = shouldSend) + + // Do we want to broadcast this position globally, or are we just telling the local node what its current position is ( + val shouldBroadcast = isAllowedToSend() + val destinationNumber = if (shouldBroadcast) DataPacket.NODENUM_BROADCAST else getNodeNum() + + // Note: we never want this message sent as a reliable message, because it is low value and we'll be sending one again later anyways + sendPosition(location, destinationNumber, wantResponse = false) } else { MeshService.warn("accuracy ${location.accuracy} is too poor to use") }