hamlib

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigAddress   = "address"
	ConfigCommand   = "command"
	ConfigArgs      = "args"
	ConfigMode      = "mode"
	ConfigLabel     = "label"
	ConfigMode1     = "mode1"
	ConfigLabel1    = "label1"
	ConfigMode2     = "mode2"
	ConfigLabel2    = "label2"
	ConfigBand      = "band"
	ConfigValue     = "value"
	ConfigVFO       = "vfo"
	ConfigUseUpDown = "use_up_down"
)
View Source
const (
	ConnectionType          = "hamlib"
	SetModeButtonType       = "hamlib.SetMode"
	ToggleModeButtonType    = "hamlib.ToggleMode"
	SetButtonType           = "hamlib.Set"
	SwitchToBandButtonType  = "hamlib.SwitchToBand"
	SetPowerLevelButtonType = "hamlib.SetPowerLevel"
	MOXButtonType           = "hamlib.MOX"
	SetVFOButtonType        = "hamlib.SetVFO"
)

Variables

This section is empty.

Functions

func NotifyFrequencyListeners

func NotifyFrequencyListeners(listeners []interface{}, frequency client.Frequency)

func NotifyModeListeners

func NotifyModeListeners(listeners []interface{}, mode client.Mode)

func NotifyPTTListeners

func NotifyPTTListeners(listeners []interface{}, ptt client.PTT)

func NotifyPowerLevelListeners

func NotifyPowerLevelListeners(listeners []interface{}, powerLevel float64)

func NotifyReconnectListeners

func NotifyReconnectListeners(listeners []interface{})

func NotifyVFOListeners

func NotifyVFOListeners(listeners []interface{}, vfo client.VFO)

Types

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

func NewButtonFactory

func NewButtonFactory(provider hamdeck.ConnectionConfigProvider, legacyAddress string) *Factory

func (*Factory) Close

func (f *Factory) Close()

func (*Factory) CreateButton

func (f *Factory) CreateButton(config map[string]interface{}) hamdeck.Button

type FrequencyListener

type FrequencyListener interface {
	SetFrequency(frequency client.Frequency)
}

type FrequencyListenerFunc

type FrequencyListenerFunc func(client.Frequency)

func (FrequencyListenerFunc) SetFrequency

func (f FrequencyListenerFunc) SetFrequency(frequency client.Frequency)

type HamlibClient

type HamlibClient struct {
	Conn *client.Conn
	// contains filtered or unexported fields
}

func NewClient

func NewClient(address string) *HamlibClient

func (*HamlibClient) Close

func (c *HamlibClient) Close()

func (*HamlibClient) Connect

func (c *HamlibClient) Connect() error

func (*HamlibClient) Connected

func (c *HamlibClient) Connected() bool

func (*HamlibClient) KeepOpen

func (c *HamlibClient) KeepOpen()

func (*HamlibClient) Listen

func (c *HamlibClient) Listen(listener interface{})

func (*HamlibClient) WithRequestTimeout

func (c *HamlibClient) WithRequestTimeout() context.Context

type MOXButton

type MOXButton struct {
	hamdeck.BaseButton
	// contains filtered or unexported fields
}

func NewMOXButton

func NewMOXButton(hamlibClient *HamlibClient, label string) *MOXButton

func (*MOXButton) Enable

func (b *MOXButton) Enable(enabled bool)

func (*MOXButton) Flash

func (b *MOXButton) Flash(flashOn bool)

func (*MOXButton) Image

func (b *MOXButton) Image(gc hamdeck.GraphicContext, redrawImages bool) image.Image

func (*MOXButton) Pressed

func (b *MOXButton) Pressed()

func (*MOXButton) Released

func (b *MOXButton) Released()

func (*MOXButton) SetPTT

func (b *MOXButton) SetPTT(ptt client.PTT)

type ModeListener

type ModeListener interface {
	SetMode(mode client.Mode)
}

type ModeListenerFunc

type ModeListenerFunc func(client.Mode)

func (ModeListenerFunc) SetMode

func (f ModeListenerFunc) SetMode(mode client.Mode)

type PTTListener

type PTTListener interface {
	SetPTT(ptt client.PTT)
}

type PTTListenerFunc

type PTTListenerFunc func(client.PTT)

func (PTTListenerFunc) SetPTT

func (f PTTListenerFunc) SetPTT(ptt client.PTT)

type PowerLevelListener

type PowerLevelListener interface {
	SetPowerLevel(powerLevel float64)
}

type PowerLevelListenerFunc

type PowerLevelListenerFunc func(float64)

func (PowerLevelListenerFunc) SetPowerLevel

func (f PowerLevelListenerFunc) SetPowerLevel(powerLevel float64)

type ReconnectListener

type ReconnectListener interface {
	Reconnected()
}

type ReconnectListenerFunc

type ReconnectListenerFunc func()

func (ReconnectListenerFunc) Reconnect

func (f ReconnectListenerFunc) Reconnect()

type SetButton

type SetButton struct {
	hamdeck.BaseButton
	// contains filtered or unexported fields
}

func NewSetButton

func NewSetButton(hamlibClient *HamlibClient, label string, command string, args ...string) *SetButton

func (*SetButton) Enable

func (b *SetButton) Enable(enabled bool)

func (*SetButton) Image

func (b *SetButton) Image(gc hamdeck.GraphicContext, redrawImage bool) image.Image

func (*SetButton) Pressed

func (b *SetButton) Pressed()

func (*SetButton) Released

func (b *SetButton) Released()

type SetModeButton

type SetModeButton struct {
	hamdeck.BaseButton
	// contains filtered or unexported fields
}

func NewSetModeButton

func NewSetModeButton(hamlibClient *HamlibClient, mode client.Mode, label string) *SetModeButton

func (*SetModeButton) Enable

func (b *SetModeButton) Enable(enabled bool)

func (*SetModeButton) Image

func (b *SetModeButton) Image(gc hamdeck.GraphicContext, redrawImages bool) image.Image

func (*SetModeButton) OnLongpress

func (b *SetModeButton) OnLongpress()

func (*SetModeButton) Pressed

func (b *SetModeButton) Pressed()

func (*SetModeButton) Released

func (b *SetModeButton) Released()

func (*SetModeButton) SetFrequency

func (b *SetModeButton) SetFrequency(frequency client.Frequency)

func (*SetModeButton) SetMode

func (b *SetModeButton) SetMode(mode client.Mode)

type SetPowerLevelButton

type SetPowerLevelButton struct {
	hamdeck.BaseButton
	// contains filtered or unexported fields
}

func NewSetPowerLevelButton

func NewSetPowerLevelButton(hamlibClient *HamlibClient, label string, value float64) *SetPowerLevelButton

func (*SetPowerLevelButton) Enable

func (b *SetPowerLevelButton) Enable(enabled bool)

func (*SetPowerLevelButton) Image

func (b *SetPowerLevelButton) Image(gc hamdeck.GraphicContext, redrawImages bool) image.Image

func (*SetPowerLevelButton) Pressed

func (b *SetPowerLevelButton) Pressed()

func (*SetPowerLevelButton) Released

func (b *SetPowerLevelButton) Released()

func (*SetPowerLevelButton) SetPowerLevel

func (b *SetPowerLevelButton) SetPowerLevel(powerLevel float64)

type SetVFOButton

type SetVFOButton struct {
	hamdeck.BaseButton
	// contains filtered or unexported fields
}

func NewSetVFOButton

func NewSetVFOButton(hamlibClient *HamlibClient, label string, vfo client.VFO) *SetVFOButton

func (*SetVFOButton) Enable

func (b *SetVFOButton) Enable(enabled bool)

func (*SetVFOButton) Image

func (b *SetVFOButton) Image(gc hamdeck.GraphicContext, redrawImages bool) image.Image

func (*SetVFOButton) Pressed

func (b *SetVFOButton) Pressed()

func (*SetVFOButton) Released

func (b *SetVFOButton) Released()

func (*SetVFOButton) SetVFO

func (b *SetVFOButton) SetVFO(vfo client.VFO)

type SwitchToBandButton

type SwitchToBandButton struct {
	hamdeck.BaseButton
	// contains filtered or unexported fields
}

func NewSwitchToBandButton

func NewSwitchToBandButton(hamlibClient *HamlibClient, label string, bandName string, useUpDown bool) *SwitchToBandButton

func (*SwitchToBandButton) Enable

func (b *SwitchToBandButton) Enable(enabled bool)

func (*SwitchToBandButton) Image

func (b *SwitchToBandButton) Image(gc hamdeck.GraphicContext, redrawImages bool) image.Image

func (*SwitchToBandButton) Pressed

func (b *SwitchToBandButton) Pressed()

func (*SwitchToBandButton) Released

func (b *SwitchToBandButton) Released()

func (*SwitchToBandButton) SetFrequency

func (b *SwitchToBandButton) SetFrequency(frequency client.Frequency)

func (*SwitchToBandButton) SetMode

func (b *SwitchToBandButton) SetMode(mode client.Mode)

type ToggleModeButton

type ToggleModeButton struct {
	hamdeck.BaseButton
	// contains filtered or unexported fields
}

func NewToggleModeButton

func NewToggleModeButton(hamlibClient *HamlibClient, mode1 client.Mode, label1 string, mode2 client.Mode, label2 string) *ToggleModeButton

func (*ToggleModeButton) Enable

func (b *ToggleModeButton) Enable(enabled bool)

func (*ToggleModeButton) Image

func (b *ToggleModeButton) Image(gc hamdeck.GraphicContext, redrawImages bool) image.Image

func (*ToggleModeButton) OnLongpress

func (b *ToggleModeButton) OnLongpress()

func (*ToggleModeButton) Pressed

func (b *ToggleModeButton) Pressed()

func (*ToggleModeButton) Released

func (b *ToggleModeButton) Released()

func (*ToggleModeButton) SetFrequency

func (b *ToggleModeButton) SetFrequency(frequency client.Frequency)

func (*ToggleModeButton) SetMode

func (b *ToggleModeButton) SetMode(mode client.Mode)

type VFOListener

type VFOListener interface {
	SetVFO(vfo client.VFO)
}

type VFOListenerFunc

type VFOListenerFunc func(client.VFO)

func (VFOListenerFunc) SetVFO

func (f VFOListenerFunc) SetVFO(vfo client.VFO)

Jump to

Keyboard shortcuts

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