Documentation
¶
Overview ¶
Package profile describes supported radios and interfaces as data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Profile ¶
type Profile struct {
ID string `json:"id"`
Name string `json:"name"`
Rig struct {
Model int `json:"model"` // hamlib model number
Baud int `json:"baud"` // CAT baud; 0 for none (dummy rig)
DeviceGlob string `json:"device_glob"` // glob for the CAT serial device; "" for none
} `json:"rig"`
Packet struct {
// How the radio is keyed for packet: "rig" (through rigctld, needs CAT), "rts" or "dtr" (a serial
// modem-control line, as on a Digirig), "cm108" (a GPIO pin on a USB sound chip) or "none" (VOX).
PTT string `json:"ptt"`
} `json:"packet"`
USBIDs []string `json:"usb_ids"` // vendor:product of the radio's USB serial chip, used to recognise it
Audio struct {
CardHints []string `json:"card_hints"` // ALSA card ids to look for, in order
Null bool `json:"null"` // no sound card (testing)
} `json:"audio"`
Notes string `json:"notes"`
}
Profile is one radio/interface combination.
func All ¶
All returns the built-in profiles plus those in userDir (a user file wins on an id clash). A user file that cannot be read or is not a valid profile is left out rather than failing everything: every service start reads the profiles, so one broken file must not stop radios that have nothing to do with it. Problems reports such files.
func Detect ¶
Detect returns the profiles whose CAT device is present right now. glob is filepath.Glob in normal use. Profiles without a device pattern (the dummy radio) never match.
func Guess ¶
Guess returns the profiles whose usb_ids include vid:pid. Many radios share one serial chip, so more than one profile can match; the caller should offer them rather than choose.