Limit repeater GPS acquisition and repair CI tests
This commit is contained in:
1 parent
9610cc4245
commit
cdd84bdb9f
8 files changed
+84
-9
No files matched your search
@@ -115,6 +115,18 @@ bool SensorManager::queryGpsTelemetry(uint8_t requester_permissions, CayenneLPP&
|
||||
gps_cache_altitude);
|
||||
return true;
|
||||
}
|
||||
if (gps_stop_after_fix && !gps_user_enabled) {
|
||||
// Repeaters acquire only when the cached position is stale. The request
|
||||
// returns without GPS while acquisition is in progress; the next request
|
||||
// can use the cached fix without waking the receiver again.
|
||||
if (!gpsTelemetryCacheFresh(now) && !gps_acquiring) {
|
||||
beginGpsTelemetryAcquisition(now);
|
||||
}
|
||||
if (!gpsTelemetryCacheFresh(now)) return false;
|
||||
telemetry.addGPS(TELEM_CHANNEL_SELF, gps_cache_lat, gps_cache_lon,
|
||||
gps_cache_altitude);
|
||||
return true;
|
||||
}
|
||||
gps_hold_until = now + GPS_TELEMETRY_HOLD_SEC * 1000UL;
|
||||
if (!telemetryGpsActive()) telemetryGpsStart();
|
||||
if (!gpsTelemetryCacheFresh(now) && !gps_acquiring) beginGpsTelemetryAcquisition(now);
|
||||
@@ -138,6 +150,11 @@ void SensorManager::processGpsTelemetryFix(float lat, float lon, float altitude,
|
||||
gps_stable_started_at = now;
|
||||
gps_stable_origin_lat = lat;
|
||||
gps_stable_origin_lon = lon;
|
||||
if (gps_stop_after_fix && !gps_user_enabled) {
|
||||
updateGpsTelemetryCache(lat, lon, altitude, now);
|
||||
finishGpsTelemetryAcquisition(now, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static const float STABLE_RADIUS_M2 =
|
||||
|
||||
@@ -18,6 +18,7 @@ class SensorManager {
|
||||
bool gps_location_access_available = false;
|
||||
bool gps_transport_available = true;
|
||||
bool gps_user_enabled = false;
|
||||
bool gps_stop_after_fix = false;
|
||||
bool gps_acquiring = false;
|
||||
bool gps_acquire_has_fix = false;
|
||||
float gps_cache_lat = 0;
|
||||
@@ -100,6 +101,13 @@ public:
|
||||
}
|
||||
virtual void loop() { }
|
||||
virtual void setTelemetryLocationAccessAvailable(bool available);
|
||||
void setGpsTelemetryStopAfterFix(bool enabled) {
|
||||
#if ENV_INCLUDE_GPS
|
||||
gps_stop_after_fix = enabled;
|
||||
#else
|
||||
(void)enabled;
|
||||
#endif
|
||||
}
|
||||
virtual int getNumSettings() const { return 0; }
|
||||
virtual const char* getSettingName(int i) const { return NULL; }
|
||||
virtual const char* getSettingValue(int i) const { return NULL; }
|
||||
|
||||
Reference in new issue
Block a user