From 1e3b037feaf299e7650464781cc88e1564319193 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Sat, 27 Mar 2021 16:17:01 +0800 Subject: [PATCH] populate position.time for broadcast positions --- docs/software/TODO.md | 10 +++++++--- src/mesh/MeshService.cpp | 5 ++++- src/plugins/PositionPlugin.cpp | 6 ++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/software/TODO.md b/docs/software/TODO.md index 1571caeff..33d1b97b6 100644 --- a/docs/software/TODO.md +++ b/docs/software/TODO.md @@ -4,9 +4,13 @@ You probably don't care about this section - skip to the next one. ## before next release -* split position.time and last_heard -* update android app to use last_heard -* have android fill in if local GPS has poor signal +* DONE have android fill in if local GPS has poor signal +* release +* fix heltec battery scaling +* add reference counting to mesh packets +* allow multiple simultanteous phoneapi connections +* DONE split position.time and last_heard +* DONE update android app to use last_heard * DONE turn off bluetooth interface ENTIRELY while using serial API (was python client times out on connect sometimes) * DONE gps assistance from phone not working? * DONE test latest firmware update with is_router diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index bc14d057a..4a42f7716 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -197,10 +197,13 @@ NodeInfo *MeshService::refreshMyNodeInfo() Position &position = node->position; - // Update our local node info with our position (even if we don't decide to update anyone else) + // Update our local node info with our time (even if we don't decide to update anyone else) node->last_heard = getValidTime(RTCQualityFromNet); // This nodedb timestamp might be stale, so update it if our clock is kinda valid + // For the time in the position field, only set that if we have a real GPS clock + position.time = getValidTime(RTCQualityGPS); + position.battery_level = powerStatus->getBatteryChargePercent(); updateBatteryLevel(position.battery_level); diff --git a/src/plugins/PositionPlugin.cpp b/src/plugins/PositionPlugin.cpp index b6f76ad72..2aaa31a5e 100644 --- a/src/plugins/PositionPlugin.cpp +++ b/src/plugins/PositionPlugin.cpp @@ -10,10 +10,8 @@ PositionPlugin *positionPlugin; PositionPlugin::PositionPlugin() : ProtobufPlugin("position", PortNum_POSITION_APP, Position_fields), concurrency::OSThread("PositionPlugin") { - isPromiscuous = true; // We always want to update our nodedb, even if we are sniffing on others - setIntervalFromNow(60 * - 1000); // Send our initial position 60 seconds after we start (to give GPS time to setup) - + isPromiscuous = true; // We always want to update our nodedb, even if we are sniffing on others + setIntervalFromNow(60 * 1000); // Send our initial position 60 seconds after we start (to give GPS time to setup) } bool PositionPlugin::handleReceivedProtobuf(const MeshPacket &mp, const Position *pptr)