fix #397 from @a-f-G-U-C - bogus GPS positions during locking could be reported

btw - from my read of the NMEA, the lowest value that means 'has a valid
position' is 1 not 2.  But I only know this because you pointed me at
it ;-)

Thanks!
This commit is contained in:
geeksville
2020-09-16 09:18:44 -07:00
parent 8c240b59f6
commit 8e988cc926
2 changed files with 11 additions and 5 deletions
+2 -2
View File
@@ -299,8 +299,8 @@ int MeshService::onGPSChanged(const meshtastic::GPSStatus *unused)
p->decoded.which_payload = SubPacket_position_tag;
Position &pos = p->decoded.position;
// !zero or !zero lat/long means valid
if (gps->latitude != 0 || gps->longitude != 0) {
if (gps->hasLock()) {
if (gps->altitude != 0)
pos.altitude = gps->altitude;
pos.latitude_i = gps->latitude;