//go:build !windows package cat import "errors" // OmniRig is COM automation against a Windows-only application, so off Windows // there is nothing to talk to. The backend still EXISTS here rather than being // compiled out of app.go, because a settings database is portable: an operator // who moves a profile from Windows to Linux keeps "omnirig" as their saved CAT // backend, and OpsLog must start and say why the rig is silent instead of // failing to build or panicking on a nil backend. // // The fix for those operators is a native backend (Icom, Yaesu, Kenwood/ // Elecraft, Flex, TCI, Xiegu all speak to the radio directly) or Hamlib. type OmniRig struct{ CWLower bool } var errOmniRigWindowsOnly = errors.New("OmniRig runs only on Windows — pick a native CAT backend (Icom, Yaesu, Kenwood/Elecraft, FlexRadio, TCI, Xiegu) in Settings ▸ CAT") func NewOmniRig(rigNum int, forceVFO string, cwLower bool) *OmniRig { return &OmniRig{CWLower: cwLower} } func (o *OmniRig) Name() string { return "omnirig" } func (o *OmniRig) Connect() error { return errOmniRigWindowsOnly } func (o *OmniRig) Disconnect() {} func (o *OmniRig) ReadState() (RigState, error) { return RigState{}, errOmniRigWindowsOnly } func (o *OmniRig) SetFrequency(hz int64) error { return errOmniRigWindowsOnly } func (o *OmniRig) SetMode(mode string) error { return errOmniRigWindowsOnly } func (o *OmniRig) SetPTT(on bool) error { return errOmniRigWindowsOnly } // SetCWLower satisfies OmniRigController so the preference push at startup is a // no-op here rather than a "backend does not support this" error in the log. func (o *OmniRig) SetCWLower(on bool) { o.CWLower = on }