From 6c9600e1e766c8b58975e425e2af07ffac487e56 Mon Sep 17 00:00:00 2001 From: Florent Date: Sat, 7 Nov 2026 13:45:40 -0400 Subject: [PATCH] gps: Rework the CLI - more consistency with other cli commands - new format for gps fix - gps format accepts postfix (s/m/d/h) - documentation --- docs/cli_commands.md | 27 +++++- docs/companion_cli.md | 27 +++++- src/helpers/CommonCLI.cpp | 12 +-- src/helpers/CommonGpsPrefs.cpp | 89 ++++++++++--------- src/helpers/sensors/LocationProvider.h | 1 + .../sensors/MicroNMEALocationProvider.h | 4 + src/helpers/sensors/RakLocationProvider.h | 4 + 7 files changed, 110 insertions(+), 54 deletions(-) diff --git a/docs/cli_commands.md b/docs/cli_commands.md index d7b8d5d01..44ff3a250 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -1021,10 +1021,10 @@ region save #### View or change the GPS acquisition period **Usage:** - `gps period` -- `gps period ` +- `gps period ` **Parameters:** -- `seconds`: `0` for continuous tracking, or `1`-`86400` for periodic acquisition +- `value`: `0` for continuous tracking, or a period. The value can be postfixed with `s`, `m`, `h` or `d` to specify the unit (seconds by default). **Note:** A periodic acquisition stops after receiving a valid fix, then resumes after the configured period. @@ -1034,7 +1034,12 @@ region save **Usage:** - `gps fix` -**Note:** Returns the last valid latitude, longitude, altitude, and elapsed time since the fix. Returns `no fix` until a valid fix is received. +**Output:** +- `> Fix (n sat): , `: the GPS currently has a fix. +- `> Last fix ago (n sat)[, acq