populate position.time for broadcast positions

This commit is contained in:
Kevin Hester
2021-03-27 16:17:01 +08:00
parent 78f2c656d0
commit 1e3b037fea
3 changed files with 13 additions and 8 deletions
+4 -1
View File
@@ -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);