GPS guard: drop time force, it goes to a separate PR

This commit is contained in:
Olexandr Tyshchenko committed 2026-11-09 22:30:24 +02:00
1 parent 181041ac64
commit eea64ffb74
2 files changed
+1 -13

No files matched your search

+1 -3
View File
@@ -69,8 +69,6 @@ This document provides an overview of CLI commands that can be sent to MeshCore
**Parameters:**
- `epoch_seconds`: Unix epoch time
**Note:** The clock only moves forward. To set it back (e.g. after the clock was pushed into the future by a wrong GPS time) use `time force <epoch_seconds>`.
---
### Send a flood advert
@@ -1082,7 +1080,7 @@ region save
#### GPS anti-spoofing guard (When built with `GPS_GUARD`)
With `GPS_GUARD`, a fix becomes the node's last fix (position, telemetry, adverts) only after it passes plausibility checks: at least `GPS_GUARD_MIN_SATS` satellites, HDOP ≤ `GPS_GUARD_MAX_HDOP10`/10, inside the optional build-time region (`GPS_GUARD_LAT_MIN/MAX`, `GPS_GUARD_LON_MIN/MAX`), within the fence around the node's configured `lat`/`lon` (if set), no jump faster than `GPS_GUARD_MAX_SPEED_KMH`, and `GPS_GUARD_STABLE_FIXES` consistent fixes in a row. An unverified position is never reported.
GPS time is written to the clock only while such a fix is current, never earlier than the firmware build date, and, once the clock is valid, only within `GPS_GUARD_TIME_MAX_STEP` seconds for the first sync and within clock drift (`GPS_GUARD_TIME_DRIFT_BASE` s + `GPS_GUARD_TIME_DRIFT_PPM`) afterwards. Setting the clock manually (`time`, `time force`, `clock sync`) resets that anchor.
GPS time is written to the clock only while such a fix is current, never earlier than the firmware build date, and, once the clock is valid, only within `GPS_GUARD_TIME_MAX_STEP` seconds for the first sync and within clock drift (`GPS_GUARD_TIME_DRIFT_BASE` s + `GPS_GUARD_TIME_DRIFT_PPM`) afterwards. Setting the clock manually (`time`, `clock sync`) resets that anchor.
Covers serial NMEA receivers (`MicroNMEALocationProvider`).
-10
View File
@@ -226,16 +226,6 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, char* command, char* re
uint32_t now = getRTCClock()->getCurrentTime();
DateTime dt = DateTime(now);
sprintf(reply, "%02d:%02d - %d/%d/%d UTC", dt.hour(), dt.minute(), dt.day(), dt.month(), dt.year());
} else if (memcmp(command, "time force ", 11) == 0) { // set time, allowing it to go backwards
uint32_t secs = _atoi(&command[11]);
if (secs > 1700000000UL) {
getRTCClock()->setCurrentTime(secs);
CommonGpsPrefs::onClockSetManually(*_sensors);
DateTime dt = DateTime(getRTCClock()->getCurrentTime());
sprintf(reply, "OK - clock forced: %02d:%02d - %d/%d/%d UTC", dt.hour(), dt.minute(), dt.day(), dt.month(), dt.year());
} else {
strcpy(reply, "ERR: invalid epoch");
}
} else if (memcmp(command, "time ", 5) == 0) { // set time (to epoch seconds)
uint32_t secs = _atoi(&command[5]);
uint32_t curr = getRTCClock()->getCurrentTime();