gps: Rework the CLI

- more consistency with other cli commands
- new format for gps fix
- gps format accepts postfix (s/m/d/h)
- documentation
This commit is contained in:
Florent committed 2026-11-08 08:47:35 -04:00
1 parent 93d165dd8c
commit 6b34ae96df
7 files changed
+110 -54

No files matched your search

+1
View File
@@ -86,6 +86,7 @@ public:
virtual bool hasHardwareEnableState() const { return false; }
virtual bool isHardwareEnabled() const { return true; }
virtual bool isGpsOn() const { return _gpsOn; }
virtual uint32_t getAcquisitionAge() const { return 0; }
virtual bool startOnce() { return false; }
virtual void setGpsOn(bool on) {
_gpsOn = on;
@@ -175,6 +175,10 @@ public:
return _gpsPeriodSeconds;
}
uint32_t getAcquisitionAge() const override {
return (uint32_t)(millis() - _acquisitionStarted) / 1000UL;
}
bool startOnce() override {
if (_gpsOn) { // already on, acquire now
_nextAcquisition = millis();
@@ -194,6 +194,10 @@ public:
return _useI2c ? _gpsOn : _nmea.isGpsOn();
}
uint32_t getAcquisitionAge() const override {
return _useI2c ? (uint32_t)(millis() - _acquisitionStarted) / 1000UL : _nmea.getAcquisitionAge();
}
bool startOnce() override {
return _useI2c ? false : _nmea.startOnce(); // not supported on the RAK12500
}