hamlib

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hamlib asks the installed hamlib which radio models it supports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caps

type Caps struct {
	Port             string // "RS-232", "Network", "USB", "None", ...
	MinBaud, MaxBaud int    // 0 when the model has no serial speed
}

Caps is what `rigctl -u` says about how a model is connected.

func ModelCaps

func ModelCaps(rigctl string, model int) (Caps, error)

ModelCaps asks the installed rigctl (next to rigctld) about a model.

func ParseCaps

func ParseCaps(text string) Caps

ParseCaps reads the text of `rigctl -m N -u`.

func (Caps) DefaultBaud

func (c Caps) DefaultBaud() int

DefaultBaud proposes a speed within the model's range: 9600 if it supports it (the usual factory setting), else the nearest it does.

func (Caps) Serial

func (c Caps) Serial() bool

Serial reports whether the model is reached over a serial port.

type Entry

type Entry struct {
	ID        int
	Mfg, Name string
	Status    string // Stable, Beta, Alpha...
	Macro     string
}

Entry is one radio model in hamlib's table.

func Filter

func Filter(entries []Entry, query string) []Entry

Filter returns the entries that match a search, best first. Every word of the query must match, ignoring case, spaces and dashes ("ic 7300", "ic7300" and "IC-7300" are the same), either as part of the maker, name or macro, or as letters in order ("ft991" finds "FT-991A", "k3" finds "Elecraft K3"). Matches that are whole parts rank above scattered ones, and a short query on its own matches the start of a name best.

func InstalledList

func InstalledList(rigctld string) ([]Entry, error)

Installed lists every model the installed rigctld supports, for choosing one.

func List

func List(r io.Reader) []Entry

List reads the table printed by `rigctld -l` with the maker and model name of each line. The columns are separated by runs of spaces; the maker or model may themselves contain single spaces ("NET rigctl").

func (Entry) Label

func (e Entry) Label() string

Label is "Icom IC-7300" (or just the maker when the model has no name, as FLRig).

type Models

type Models map[int]string

Models maps a hamlib model number to its driver status (Stable, Beta, Alpha...).

func Installed

func Installed(rigctld string) (Models, error)

Installed runs `<rigctld> -l` and parses its output. rigctld is the path of the program to ask.

func Parse

func Parse(r io.Reader) Models

Parse reads the table printed by `rigctld -l`. Columns are: model number, manufacturer, model name, driver version, status, macro. Manufacturer and name may contain spaces, so only the first field and the last two are relied on.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL