Documentation
¶
Overview ¶
Package patcfg creates and reads Pat (Winlink client) config files.
Index ¶
- func HFPort(path string) (int, bool)
- func Locator(path string) (string, bool)
- func Minimal(o Options) ([]byte, error)
- func PacketPort(path string) (int, bool)
- func SetLocator(path, grid string) (backup string, err error)
- func Wire(path string, w Wiring) (backup string, changed []string, err error)
- type Found
- type Options
- type RigRef
- type Wiring
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HFPort ¶
HFPort returns the port of the VARA HF modem a Pat config points at (varahf.addr), and whether it has one. Only that field is read.
func Locator ¶
Locator returns the locator set in a Pat config, and whether there is one. Only that field is read.
func Minimal ¶
Minimal returns a starter Pat config for a station that talks to Mercury through rigctld. Pat fills in every other setting with its own defaults. The Winlink password is NOT set: the user adds it in Pat (web UI settings or `pat configure`).
With modem=false (Mercury is not part of the setup) only the callsign and web UI address are written, which is enough for Winlink over the internet.
func PacketPort ¶
PacketPort returns the port of the AGWPE TNC (Direwolf) a Pat config uses for AX.25, and whether it is set up for AGWPE at all. Only those fields are read.
func SetLocator ¶
SetLocator changes only the locator in a Pat config. Every other value is kept exactly as it is (passwords included, which are never looked at), but the file is rewritten with sorted keys, so the original is first copied to path+".hamstack-bak". It returns the backup's path.
func Wire ¶
Wire updates a Pat config to match w and returns the top-level settings it changed. Only the locator, hamlib_rigs, varahf, ax25, agwpe and gpsd are touched, and inside them only the members named here; every other setting (passwords included) is kept. If anything changes, the original is first copied to path+".hamstack-bak" and the file is rewritten with sorted keys. Nothing is written if nothing differs.
Types ¶
type Found ¶
type Found struct {
File string
ID string // suggested station id
Callsign string
HTTPAddr string
Default bool // config.json (Pat's default config) points at this file
Grid string // the locator in that file, if any (a suggestion for the operator's grid)
}
Found is a Pat config discovered on disk.
type Options ¶
type Options struct {
Callsign, HTTPAddr string
Grid string // locator; omitted when empty
Rigs []RigRef // every rig, so Pat can tune any of them
HFRig string // the rig whose Mercury Pat's VARA HF connection uses; "" for none
HFArqPort int // that Mercury's ARQ port
Packet bool // Direwolf is part of the setup: use its AGWPE interface for AX.25
PacketRig string // the rig Pat tunes for packet connections ("" if it has no CAT)
AGWPort int
}
Options says what a starter Pat config should contain.
type Wiring ¶
type Wiring struct {
Grid string // locator; "" leaves it alone
Rigs []RigRef // rigctld connections, by rig name; entries here are set, other entries are kept
HFRig string // the rig whose Mercury Pat's VARA HF uses; "" leaves varahf alone
HFArqPort int
PacketRig string // the rig Pat tunes for packet ("" for a rig with no CAT)
Packet bool // Pat's AX.25 should use Direwolf's AGWPE port
AGWPort int
GPSAddr string // gpsd's address ("host:port"); "" leaves Pat's gpsd settings alone
}
Wiring is what a station's Pat config should say about the radios at the current site.