mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-11-23 00:47:58 +00:00
GPS guard: drop time force, it goes to a separate PR
This commit is contained in:
1 parent
181041ac64
commit
eea64ffb74
2 files changed
+1
-13
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user