Refactored status handlers and merged

This commit is contained in:
Professr
2020-06-28 18:17:52 -07:00
20 changed files with 426 additions and 268 deletions

View File

@@ -128,14 +128,9 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s
} else // we didn't get a location update, go back to sleep and hope the characters show up
wantNewLocation = true;
meshtastic::GPSStatus status;
status.hasLock = hasLock();
status.isConnected = isConnected;
status.latitude = latitude;
status.longitude = longitude;
status.altitude = altitude;
status.dop = dop;
newStatus.notifyObservers(status);
// Notify any status instances that are observing us
const meshtastic::GPSStatus status = meshtastic::GPSStatus(hasLock(), isConnected, latitude, longitude, altitude, dop);
newStatus.notifyObservers(&status);
// Once we have sent a location once we only poll the GPS rarely, otherwise check back every 1s until we have something over
// the serial