Documentation
¶
Overview ¶
Package rigctld implements a subset of Hamlib's rigctld TCP wire protocol so external amateur-radio tooling (Cloudlog, N1MM, GridTracker, PSTRotator, satellite trackers, logging programs) can read and set the frequency of one of GopherTrunk's SDRs over the network.
rigctld is a text-line protocol — each line is one command, the server replies with one or more text lines terminated by an "RPRT <errno>\n" report code line ("RPRT 0" on success). Many clients use both the short single-character form (e.g. "F 851012500") and the long form ("set_freq 851012500"); both are accepted here.
The implementation targets the ~10 commands real clients actually send. Anything else returns RPRT -1 (Hamlib's "command not supported" code), matching how real rigctld handles capability limits on minimal backends. The goal is interop with logging programs and frequency trackers — not full Hamlib coverage.
GopherTrunk's "rig" is one SDR in the pool, identified by serial. The controller abstraction (Controller interface) lets the daemon wire whichever SDR makes sense (the control SDR, by default); the server itself stays free of sdr.Pool details so it can be unit- tested with a fake Controller.
Index ¶
Constants ¶
const DefaultListenAddr = "127.0.0.1:4532"
DefaultListenAddr is the address the server binds when callers don't override it. Matches the Hamlib rigctld default port.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
Controller is the subset of the daemon a rigctld server needs. Implementations hide whichever sdr.Device or iqtap.Broker the daemon decides to expose. Freq is in Hz; SetFreq returns an error when the device rejects the value or no rig is wired.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is one TCP listener that accepts rigctld clients. A daemon spawns one Server per logical rig; today GopherTrunk wires exactly one (the control SDR's frequency).
func New ¶
New constructs a Server. addr defaults to DefaultListenAddr when empty. ctrl must be non-nil — the server doesn't run without something to control.
func (*Server) BoundAddr ¶
BoundAddr reports the listener's bound address. Empty before Run has bound or after Close. Useful when the caller configured a ":0" port and needs the kernel-assigned value.