flexclient

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discover

func Discover(specString string) (map[string]string, error)

Types

type CmdResult

type CmdResult struct {
	Serial  uint32
	Error   uint32
	Message string
}

func (CmdResult) String

func (c CmdResult) String() string

type FlexClient

type FlexClient struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewFlexClient

func NewFlexClient(dst string) (*FlexClient, error)

func (*FlexClient) ClientID

func (f *FlexClient) ClientID() string

func (*FlexClient) Close

func (f *FlexClient) Close() error

func (*FlexClient) FindObjects

func (f *FlexClient) FindObjects(pfx string) State

func (*FlexClient) GetObject

func (f *FlexClient) GetObject(key string) (Object, bool)

func (*FlexClient) InitUDP

func (f *FlexClient) InitUDP() error

Makes a UDP listen socket and asks the radio to deliver VITA-49 packets to it. Must be done before calling RunUDP.

func (*FlexClient) RadioSet

func (f *FlexClient) RadioSet(values Object) CmdResult

func (*FlexClient) Run

func (f *FlexClient) Run()

func (*FlexClient) RunUDP

func (f *FlexClient) RunUDP()

Requires InitUDP() to have been called. This should be run inside a goroutine, but doesn't create one on its own, so that the caller may create their own and acquire realtime priority for it if they wish.

func (*FlexClient) SendAndWait

func (f *FlexClient) SendAndWait(cmd string) CmdResult

func (*FlexClient) SendCmd

func (f *FlexClient) SendCmd(cmd string) uint32

func (*FlexClient) SendNotify

func (f *FlexClient) SendNotify(cmd string) ResultHandle

func (*FlexClient) SendUdp

func (f *FlexClient) SendUdp(pkt []byte) error

func (*FlexClient) SetMessageChan

func (f *FlexClient) SetMessageChan(ch chan Message)

func (*FlexClient) SetUDPPort

func (f *FlexClient) SetUDPPort(port int)

func (*FlexClient) SetVitaChan

func (f *FlexClient) SetVitaChan(ch chan VitaPacket)

func (*FlexClient) SliceSet

func (f *FlexClient) SliceSet(sliceIdx string, values Object) CmdResult

func (*FlexClient) SliceSetFilter

func (f *FlexClient) SliceSetFilter(sliceIdx string, filterLo, filterHi int) CmdResult

func (*FlexClient) SliceTune

func (f *FlexClient) SliceTune(sliceIdx string, freq float64) CmdResult

func (*FlexClient) StartUDP

func (f *FlexClient) StartUDP() error

Calls InitUDP(), returning error if any, then calls RunUDP() in a goroutine. Provided for interface compatibility with existing clients, and for simplicity for those that don't care about RT scheduling.

func (*FlexClient) Subscribe

func (f *FlexClient) Subscribe(sub Subscription) Subscription

func (*FlexClient) TransmitSet

func (f *FlexClient) TransmitSet(values Object) CmdResult

func (*FlexClient) TransmitTune

func (f *FlexClient) TransmitTune(val string) CmdResult

func (*FlexClient) Unsubscribe

func (f *FlexClient) Unsubscribe(sub Subscription)

type Message

type Message struct {
	SenderHandle string
	Message      string
}

type Object

type Object map[string]string

func (Object) Copy

func (o Object) Copy() Object

type ResultHandle added in v0.2.0

type ResultHandle struct {
	Serial uint32
	C      chan CmdResult
	// contains filtered or unexported fields
}

func (*ResultHandle) Close added in v0.2.0

func (h *ResultHandle) Close()

type State

type State map[string]Object

type StateUpdate

type StateUpdate struct {
	SenderHandle string
	Object       string
	Updated      Object
	CurrentState Object
}

type Subscription

type Subscription struct {
	Prefix  string
	Updates chan StateUpdate
}

type VitaPacket

type VitaPacket struct {
	Preamble *vita.VitaPacketPreamble
	Payload  []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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