From d0fb3634223f645669074447d13f8877fa81b961 Mon Sep 17 00:00:00 2001 From: a-f-G-U-C <65810997+a-f-G-U-C@users.noreply.github.com> Date: Sat, 23 Oct 2021 01:58:56 +0000 Subject: [PATCH] discriminate local/remote node position updates (#889) --- src/mesh/MeshService.cpp | 2 +- src/mesh/NodeDB.cpp | 2 +- src/mesh/NodeDB.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index c8865030..c5e4481b 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -236,7 +236,7 @@ int MeshService::onGPSChanged(const meshtastic::GPSStatus *unused) DEBUG_MSG("got gps notify time=%u, lat=%d, bat=%d\n", pos.time, pos.latitude_i, pos.battery_level); // Update our current position in the local DB - nodeDB.updatePosition(nodeDB.getNodeNum(), pos); + nodeDB.updatePosition(nodeDB.getNodeNum(), pos, RX_SRC_LOCAL); return 0; } diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index d4bbf59b..dc46b7ae 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -447,7 +447,7 @@ size_t NodeDB::getNumOnlineNodes() /** Update position info for this node based on received position data */ -void NodeDB::updatePosition(uint32_t nodeId, const Position &p) +void NodeDB::updatePosition(uint32_t nodeId, const Position &p, RxSource src) { NodeInfo *info = getOrCreateNode(nodeId); diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index bd734645..86ab874e 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -59,7 +59,7 @@ class NodeDB /** Update position info for this node based on received position data */ - void updatePosition(uint32_t nodeId, const Position &p); + void updatePosition(uint32_t nodeId, const Position &p, RxSource src = RX_SRC_RADIO); /** Update user info for this node based on received user data */