jgauchia / IceNav-v3

ESP32 Based GPS Navigator with OSM offline maps. Multi GNSS - (Under development)
GNU General Public License v3.0
118 stars 15 forks source link

Fix issue 212 cli defaults #214

Closed hpsaturn closed 1 month ago

hpsaturn commented 1 month ago

Description

Now is possible define some settings only for the user via CLI, writing them on the preferences manifest, like this:

#define CONFIG_KEYS_LIST                 \
  X(KMAP_ROT, "Map_rot", BOOL)           \
  X(KMAP_SPEED, "Map_speed", BOOL)       \
  X(KMAP_SCALE, "Map_scale", BOOL)       \
  X(KMAP_COMPASS, "Map_compass", BOOL)   \
  X(KMAP_VECTOR, "Map_vector", BOOL)     \
  X(KMAP_MODE, "Map_mode", BOOL)         \
...
  X(KCOMP_X, "Compass_X", INT)           \
  X(KGPS_RATE, "GPS_rate", SHORT)        \
  X(KWEB_FILE, "Web_file", BOOL)         \
  X(KUSER, "-----", UNKNOWN)             \      <==== below start the user preferences for the CLI
  X(KDEF_ZOOM, "Def_zoom", UINT)         \
  X(KGPS_TX, "GPS_tx", UINT)             \
  X(KGPS_RX, "GPS_rx", UINT)             \
  X(KLAT_DFL, "defLAT", DOUBLE)          \
  X(KLON_DFL, "defLON", DOUBLE)          \
  X(KCOUNT, "KCOUNT", UNKNOWN)

And the result is something like that:

screenshot20241005_004524

then now we have two commands:

klist:          list of user extra preferences
kset:          set an user extra preference

Changes

33ff434 changed to verbose the lat/lon logs 08190d5 now lat/lon is checked from three sources, gps, settings and env e767db7 two new CLI commands for set preferences. kset and klist bd1bb6a added WCLI library with power issue fixed