Documentation ¶
Overview ¶
Package hamlib provides bindings for a _subset_ of hamlib. It provides both native cgo bindings and a rigctld client.
Use build tag "libhamlib" to build with native C library support.
Index ¶
Constants ¶
const DefaultTCPAddr = "localhost:4532"
Variables ¶
var ErrNotVFOMode = errors.New("rigctl is not running in VFO mode")
var ErrUnexpectedValue = fmt.Errorf("Unexpected value in response")
var TCPTimeout = 30 * time.Second
TCPTimeout defines the timeout duration of dial, read and write operations.
Functions ¶
Types ¶
type Rig ¶
type Rig interface { // Closes the connection to the Rig. Close() error // Returns the Rig's active VFO (for control). CurrentVFO() VFO // Returns the Rig's A-VFO (for control). VFOA() (VFO, error) // Returns the Rig's B-VFO (for control). VFOB() (VFO, error) }
Rig represents a receiver or tranceiver.
It holds the data connection to the device.
func OpenSerialURI ¶
OpenSerialURI is here for compatibility (use build tag 'libhamlib').
type RigModel ¶
type RigModel int
RigModel is the hamlib ID identifying a spesific tranceiver model.
type TCPRig ¶
type TCPRig struct {
// contains filtered or unexported fields
}
Rig represents a receiver or tranceiver.
It holds the tcp connection to the service (rigctld).
func OpenTCP ¶
OpenTCP opens a new TCPRig and returns a ready to use Rig.
The connection to rigctld is not initiated until the connection is requred. To check for a valid connection, call Ping.
Caller must remember to Close the Rig after use.
func (*TCPRig) CurrentVFO ¶
Returns the Rig's active VFO (for control).
func (*TCPRig) Ping ¶
Ping checks that a connection to rigctld is open and valid.
If no connection is active, it will try to establish one.
func (*TCPRig) VFOA ¶
Returns the Rig's VFO A (for control).
ErrNotVFOMode is returned if rigctld is not in VFO mode.
type VFO ¶
type VFO interface { // Gets the dial frequency for this VFO. GetFreq() (int, error) // Sets the dial frequency for this VFO. SetFreq(f int) error // GetPTT returns the PTT state for this VFO. GetPTT() (bool, error) // Enable (or disable) PTT on this VFO. SetPTT(on bool) error }
VFO (Variable Frequency Oscillator) represents a tunable channel, from the radio operator's view.
Also referred to as "BAND" (A-band/B-band) by some radio manufacturers.