Skip to content

Accept a whole ConfigTarget as JSON in satpulsetool gps #372

Description

@jclark

The JSON ConfigTarget interface already exists end to end (the workbench posts {Props, Opts} to /api/config/apply), but the two halves speak different vocabularies: Props has name-based custom marshaling in the readback vocabulary, while Opts uses default struct marshaling with raw integer flag values, which the webui hand-mirrors in msg-flags.ts ("keep in sync" by hand). Any bit renumbering in configtarget.go silently corrupts webui requests.

Separately, satpulsetool gps predates gpshwtest and does not expose all of configtarget.go: SetStatic is hidden, NMEAMsgOther/RTCMMsgOther and unaligned time pulses are inexpressible, and --survey always sets SurveyAgain, so several model semantics cannot be exercised from the command line at all.

Plan in plan/config-target-json.md, two parts:

  1. Give the ConfigOptions flag and enum types a name-based JSON vocabulary (arrays of names modeled on PropIDs, names derived from the model constants: timePulse, leapSecond, navData, ...; SaveType/ResetType as text enums), and flip the webui to send names in the same change.
  2. Add a hidden --target-json argument to satpulsetool gps that accepts a whole ConfigTarget as JSON (inline or - for stdin), mutually exclusive with the config-shaping flags, policy-free, with ClearReadOnlyProps applied so a --show-config result feeds back verbatim.

Part 2 makes every configtarget.go semantic expressible without per-flag CLI work; see the closing section of gpshwtest-fixes.md for the semantics this unlocks for testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions