Documentation ¶
Overview ¶
The package client provides a client implementation for the TCI protocol.
Index ¶
- Constants
- Variables
- func NewTXAudioMessage(trx int, sampleRate AudioSampleRate, samples []float32) ([]byte, error)
- type ARGB
- type AppFocusListener
- type AudioSampleRate
- type AudioSampleRateListener
- type BinaryMessage
- type BinaryMessageListener
- type BinaryMessageType
- type CTCSSEnableListener
- type CTCSSLevelListener
- type CTCSSMode
- type CTCSSModeListener
- type CTCSSRXToneListener
- type CTCSSTXToneListener
- type CTCSSTone
- type CWMacrosDelayListener
- type CWMacrosEmptyListener
- type CWMacrosSpeedListener
- type ChannelCountListener
- type Client
- func (c *Client) AddSpot(callsign string, mode Mode, frequency int, color ARGB, text string) error
- func (c *Client) AudioSampleRate() (AudioSampleRate, error)
- func (c *Client) BringToFront() error
- func (c *Client) CTCSSEnable(trx int) (bool, error)
- func (c *Client) CTCSSLevel(trx int) (int, error)
- func (c *Client) CTCSSMode(trx int) (CTCSSMode, error)
- func (c *Client) CTCSSRXTone(trx int) (CTCSSTone, error)
- func (c *Client) CTCSSTXTone(trx int) (CTCSSTone, error)
- func (c *Client) CWMacrosDelay() (int, error)
- func (c *Client) CWMacrosSpeed() (int, error)
- func (c *Client) CWMacrosSpeedDec(delta int) error
- func (c *Client) CWMacrosSpeedInc(delta int) error
- func (c *Client) ClearSpots() error
- func (c *Client) Connected() bool
- func (c *Client) DDS(trx int) (int, error)
- func (c *Client) DeleteSpot(callsign string) error
- func (c *Client) Disconnect()
- func (c *Client) Drive() (int, error)
- func (c *Client) ECoderSwitchChannel(ecoder int) (VFO, error)
- func (c *Client) ECoderSwitchRX(ecoder int) (int, error)
- func (c *Client) IF(trx int, vfo VFO) (int, error)
- func (c *Client) IQSampleRate() (IQSampleRate, error)
- func (c *Client) Mode(trx int) (Mode, error)
- func (c *Client) Mute() (bool, error)
- func (n Client) Notify(listener interface{})
- func (c *Client) RITEnable(trx int) (bool, error)
- func (c *Client) RITOffset(trx int) (int, error)
- func (c *Client) RXANCEnable(trx int) (bool, error)
- func (c *Client) RXANFEnable(trx int) (bool, error)
- func (c *Client) RXAPFEnable(trx int) (bool, error)
- func (c *Client) RXBalance(trx int, vfo VFO) (int, error)
- func (c *Client) RXBinEnable(trx int) (bool, error)
- func (c *Client) RXChannelEnable(trx int, vfo VFO) (bool, error)
- func (c *Client) RXDSEEnable(trx int) (bool, error)
- func (c *Client) RXEnable(trx int) (bool, error)
- func (c *Client) RXFilterBand(trx int) (int, int, error)
- func (c *Client) RXMute(trx int) (bool, error)
- func (c *Client) RXNBEnable(trx int) (bool, error)
- func (c *Client) RXNBParams(trx int) (int, int, error)
- func (c *Client) RXNFEnable(trx int) (bool, error)
- func (c *Client) RXNREnable(trx int) (bool, error)
- func (c *Client) RXSMeter(trx int, vfo VFO) (int, error)
- func (c *Client) RXVolume(trx int, vfo VFO) (int, error)
- func (c *Client) Ready()
- func (c *Client) SendCWMacro(trx int, text string) error
- func (c *Client) SendCWMessage(trx int, before string, callsign string, after string) error
- func (c *Client) SendCallsign(callsign string) error
- func (c *Client) SendTXAudio(trx int, sampleRate AudioSampleRate, samples []float32) error
- func (c *Client) SetAudioSampleRate(sampleRate AudioSampleRate) error
- func (c *Client) SetCTCSSEnable(trx int, muted bool) error
- func (c *Client) SetCTCSSLevel(trx int, percent int) error
- func (c *Client) SetCTCSSMode(trx int, mode CTCSSMode) error
- func (c *Client) SetCTCSSRXTone(trx int, tone CTCSSTone) error
- func (c *Client) SetCTCSSTXTone(trx int, tone CTCSSTone) error
- func (c *Client) SetCWMacrosDelay(delay int) error
- func (c *Client) SetCWMacrosSpeed(wpm int) error
- func (c *Client) SetCWTerminal(enabled bool) error
- func (c *Client) SetDDS(trx int, frequency int) error
- func (c *Client) SetDrive(percent int) error
- func (c *Client) SetECoderSwitchChannel(ecoder int, vfo VFO) error
- func (c *Client) SetECoderSwitchRX(ecoder int, trx int) error
- func (c *Client) SetIF(trx int, vfo VFO, frequency int) error
- func (c *Client) SetIQSampleRate(sampleRate IQSampleRate) error
- func (c *Client) SetMode(trx int, mode Mode) error
- func (c *Client) SetMute(muted bool) error
- func (c *Client) SetRITEnable(trx int, enabled bool) error
- func (c *Client) SetRITOffset(trx int, offset int) error
- func (c *Client) SetRXANCEnable(trx int, enabled bool) error
- func (c *Client) SetRXANFEnable(trx int, enabled bool) error
- func (c *Client) SetRXAPFEnable(trx int, enabled bool) error
- func (c *Client) SetRXBalance(trx int, vfo VFO, dB int) error
- func (c *Client) SetRXBinEnable(trx int, enabled bool) error
- func (c *Client) SetRXChannelEnable(trx int, vfo VFO, enabled bool) error
- func (c *Client) SetRXDSEEnable(trx int, enabled bool) error
- func (c *Client) SetRXEnable(trx int, enabled bool) error
- func (c *Client) SetRXFilterBand(trx int, min, max int) error
- func (c *Client) SetRXMute(trx int, muted bool) error
- func (c *Client) SetRXNBEnable(trx int, enabled bool) error
- func (c *Client) SetRXNBParams(trx int, threshold int, impulseLength int) error
- func (c *Client) SetRXNFEnable(trx int, enabled bool) error
- func (c *Client) SetRXNREnable(trx int, enabled bool) error
- func (c *Client) SetRXSMeter(trx int, vfo VFO, level int) error
- func (c *Client) SetRXSensorsEnable(enabled bool, milliseconds int) error
- func (c *Client) SetRXVolume(trx int, vfo VFO, dB int) error
- func (c *Client) SetSplitEnable(trx int, enabled bool) error
- func (c *Client) SetSquelchEnable(trx int, enabled bool) error
- func (c *Client) SetSquelchLevel(dB int) error
- func (c *Client) SetTRXDrive(trx int, percent int) error
- func (c *Client) SetTRXTuneDrive(trx int, percent int) error
- func (c *Client) SetTX(trx int, enabled bool, source SignalSource) error
- func (c *Client) SetTXSensorsEnable(enabled bool, milliseconds int) error
- func (c *Client) SetTimeout(timeout time.Duration)
- func (c *Client) SetTune(trx int, enabled bool) error
- func (c *Client) SetTuneDrive(percent int) error
- func (c *Client) SetVFOFrequency(trx int, vfo VFO, frequency int) error
- func (c *Client) SetVolume(dB int) error
- func (c *Client) SetXITEnable(trx int, enabled bool) error
- func (c *Client) SetXITOffset(trx int, offset int) error
- func (c *Client) SplitEnable(trx int) (bool, error)
- func (c *Client) SquelchEnable(trx int) (bool, error)
- func (c *Client) SquelchLevel() (int, error)
- func (c *Client) Start() error
- func (c *Client) StartAudio(trx int) error
- func (c *Client) StartIQ(trx int) error
- func (c *Client) Stop() error
- func (c *Client) StopAudio(trx int) error
- func (c *Client) StopCW() error
- func (c *Client) StopIQ(trx int) error
- func (c *Client) TRXDrive(trx int) (int, error)
- func (c *Client) TRXTuneDrive(trx int) (int, error)
- func (c *Client) TX(trx int) (bool, error)
- func (c *Client) Timeout() time.Duration
- func (c *Client) Tune(trx int) (bool, error)
- func (c *Client) TuneDrive() (int, error)
- func (c *Client) VFOFrequency(trx int, vfo VFO) (int, error)
- func (c *Client) Volume() (int, error)
- func (c *Client) WhenDisconnected(f func())
- func (c *Client) XITEnable(trx int) (bool, error)
- func (c *Client) XITOffset(trx int) (int, error)
- type ConnectionListener
- type ConnectionListenerFunc
- type DDSListener
- type DeviceInfo
- func (d *DeviceInfo) SetChannelCount(count int)
- func (d *DeviceInfo) SetDeviceName(name string)
- func (d *DeviceInfo) SetIFLimits(min int, max int)
- func (d *DeviceInfo) SetModes(modes []Mode)
- func (d *DeviceInfo) SetProtocol(name string, version string)
- func (d *DeviceInfo) SetRXOnly(value bool)
- func (d *DeviceInfo) SetTRXCount(count int)
- func (d *DeviceInfo) SetVFOLimits(min int, max int)
- type DeviceNameListener
- type DriveListener
- type ECoderSwitchChannelListener
- type ECoderSwitchRXListener
- type IFLimitsListener
- type IFListener
- type IQDataListener
- type IQSampleRate
- type IQSampleRateListener
- type Message
- func (m Message) Args() []string
- func (m Message) IsReplyTo(o Message) bool
- func (m Message) Name() string
- func (m Message) String() string
- func (m Message) ToBool(i int) (bool, error)
- func (m Message) ToFloat(i int) (float64, error)
- func (m Message) ToInt(i int) (int, error)
- func (m Message) ToString(i int) (string, error)
- type MessageListener
- type Mode
- type ModeListener
- type ModesListener
- type MuteListener
- type ProtocolListener
- type RITEnableListener
- type RITOffsetListener
- type RXANCEnableListener
- type RXANFEnableListener
- type RXAPFEnableListener
- type RXAudioListener
- type RXBalanceListener
- type RXBinEnableListener
- type RXChannelEnableListener
- type RXDSEEnableListener
- type RXEnableListener
- type RXFilterBandListener
- type RXMuteListener
- type RXNBEnableListener
- type RXNBParamsListener
- type RXNFEnableListener
- type RXNREnableListener
- type RXOnlyListener
- type RXSMeterListener
- type RXSensorsListener
- type RXVolumeListener
- type ReadyListener
- type SignalSource
- type SplitEnableListener
- type SquelchEnableListener
- type SquelchLevelListener
- type StartAudioListener
- type StartIQListener
- type StartListener
- type StopAudioListener
- type StopIQListener
- type StopListener
- type TRXCountListener
- type TRXDriveListener
- type TRXTuneDriveListener
- type TXChronoListener
- type TXEnableListener
- type TXFootswitchListener
- type TXFrequencyListener
- type TXListener
- type TXPowerListener
- type TXSWRListener
- type TXSensorsListener
- type TuneDriveListener
- type TuneListener
- type VFO
- type VFOFrequencyListener
- type VFOLimitsListener
- type VolumeListener
- type XITEnableListener
- type XITOffsetListener
Constants ¶
const ( VFOA = VFO(0) VFOB = VFO(1) )
All available VFOs in TCI.
const ( ModeAM = Mode("am") ModeSAM = Mode("sam") ModeDSB = Mode("dsb") ModeLSB = Mode("lsb") ModeUSB = Mode("usb") ModeCW = Mode("cw") ModeNFM = Mode("nfm") ModeWFM = Mode("wfm") ModeSPEC = Mode("spec") ModeDIGL = Mode("digl") ModeDIGU = Mode("digu") ModeDRM = Mode("drm") )
All modes acvailable in TCI.
const ( SignalSourceDefault = SignalSource("") SignalSourceMIC = SignalSource("mic") SignalSourceVAC = SignalSource("vac") )
All available sources for the TX audio signal.
const ( IQSampleRate48k = IQSampleRate(48000) IQSampleRate96k = IQSampleRate(96000) IQSampleRate192k = IQSampleRate(192000) )
All available sample rates for IQ data.
const ( AudioSampleRate8k = AudioSampleRate(8000) AudioSampleRate12k = AudioSampleRate(12000) AudioSampleRate24k = AudioSampleRate(24000) AudioSampleRate48k = AudioSampleRate(48000) )
All available sample rates for audio data.
const DefaultPort = 40001
DefaultPort of TCI
Variables ¶
var DefaultTimeout = time.Duration(50 * time.Millisecond)
DefaultTimeout is the default duration to wait for the reply of a command.
var ErrNotConnected = errors.New("not connected")
ErrNotConnected indicates that there is currently no TCI connection available.
var ErrTimeout = errors.New("timeout")
ErrTimeout indicates a timeout while waiting for the reply of a command.
Functions ¶
func NewTXAudioMessage ¶
func NewTXAudioMessage(trx int, sampleRate AudioSampleRate, samples []float32) ([]byte, error)
NewTXAudioMessage returns a binary message of type TXAudioStream that contains the given samples. The binary message can directly be send through a websocket connection to the TCI server.
Types ¶
type ARGB ¶
type ARGB uint32
ARGB represents a color with four (alpha, red, green, blue) 8-bit channels.
type AppFocusListener ¶
type AppFocusListener interface {
SetAppFocus(focussed bool)
}
A AppFocusListener is notified when a APP_FOCUS message is received from the TCI server.
type AudioSampleRate ¶
type AudioSampleRate int
AudioSampleRate represents the sample rate for audio data in samples per second.
type AudioSampleRateListener ¶
type AudioSampleRateListener interface {
SetAudioSampleRate(sampleRate AudioSampleRate)
}
A AudioSampleRateListener is notified when a AUDIO_SAMPLERATE message is received from the TCI server.
type BinaryMessage ¶
type BinaryMessage struct { TRX int SampleRate int Format int Codec int CRC uint32 DataLength uint32 Type BinaryMessageType Data []float32 }
BinaryMessage represents a binary message that is exchanged between the TCI server and a client.
func ParseBinaryMessage ¶
func ParseBinaryMessage(b []byte) (BinaryMessage, error)
ParseBinaryMessage parses the given byte slice as incoming binary message.
type BinaryMessageListener ¶
type BinaryMessageListener interface {
BinaryMessage(msg BinaryMessage)
}
A BinaryMessageListener is notified when any binary message (IQ data, audio data, or tx chrono) is received from the TCI server.
type BinaryMessageType ¶
type BinaryMessageType uint32
BinaryMessageType represents the type of a BinaryMessage
const ( IQStreamMessage BinaryMessageType = iota RXAudioStreamMessage TXAudioStreamMessage TXChronoMessage )
All message types available in TCI.
type CTCSSEnableListener ¶
A CTCSSEnableListener is notified when a CTCSS_ENABLE message is received from the TCI server.
type CTCSSLevelListener ¶
A CTCSSLevelListener is notified when a CTCSS_LEVEL message is received from the TCI server.
type CTCSSModeListener ¶
A CTCSSModeListener is notified when a CTCSS_MODE message is received from the TCI server.
type CTCSSRXToneListener ¶
A CTCSSRXToneListener is notified when a CTCSS_RX_TONE message is received from the TCI server.
type CTCSSTXToneListener ¶
A CTCSSTXToneListener is notified when a CTCSS_TX_TONE message is received from the TCI server.
type CWMacrosDelayListener ¶
type CWMacrosDelayListener interface {
SetCWMacrosDelay(delay int)
}
A CWMacrosDelayListener is notified when a CW_MACROS_DELAY message is received from the TCI server.
type CWMacrosEmptyListener ¶ added in v0.3.0
type CWMacrosEmptyListener interface {
CWMacrosEmpty()
}
A CWMacrosEmptyListener is notified then a CW_MACROS_EMPTY message is received from the TCI server. (since TCI 1.5)
type CWMacrosSpeedListener ¶
type CWMacrosSpeedListener interface {
SetCWMacrosSpeed(wpm int)
}
A CWMacrosSpeedListener is notified when a CW_MACROS_SPEED message is received from the TCI server.
type ChannelCountListener ¶
type ChannelCountListener interface {
SetChannelCount(count int)
}
A ChannelCountListener is notified when a CHANNEL_COUNT message is received from the TCI server.
type Client ¶
type Client struct { DeviceInfo // contains filtered or unexported fields }
Client represents a TCI client.
func KeepOpen ¶
func KeepOpen(host *net.TCPAddr, retryInterval time.Duration, trace bool, listeners ...interface{}) *Client
KeepOpen opens a connection to the given host and tries to keep an open connection by automatically trying to reconnect when an established connection is lost (after the given grace period). The given listeners are notified about any incoming message. KeepOpen returns immediately. If you want to know when the connection is available, add a ConnectionListener to the list of listeners.
func Open ¶
Open a connection to the given host. The given listeners are notified about any incoming message. Open returns as soon as the READY; message was received.
func (*Client) AudioSampleRate ¶
func (c *Client) AudioSampleRate() (AudioSampleRate, error)
AudioSampleRate reads the sample rate for Audio data.
func (*Client) BringToFront ¶
BringToFront brings main ExpertSDR window into the focus.
func (*Client) CTCSSEnable ¶
CTCSSEnable reads enable state of CTCSS for the given TRX.
func (*Client) CTCSSLevel ¶
CTCSSLevel reads the given TRX's CTCSS subtone level for transmitting in percent.
func (*Client) CTCSSRXTone ¶
CTCSSRXTone reads the given TRX's CTCSS subtone for receiving.
func (*Client) CTCSSTXTone ¶
CTCSSTXTone reads the given TRX's CTCSS subtone for transmitting.
func (*Client) CWMacrosDelay ¶
CWMacrosDelay reads the delay for transmitting CW macros in milliseconds.
func (*Client) CWMacrosSpeed ¶
CWMacrosSpeed reads the speed in WPM for CW macros.
func (*Client) CWMacrosSpeedDec ¶
CWMacrosSpeedDec decreases the speed for CW macros by the given delta in WPM.
func (*Client) CWMacrosSpeedInc ¶
CWMacrosSpeedInc increases the speed for CW macros by the given delta in WPM.
func (*Client) DeleteSpot ¶
DeleteSpot deletes the spot with the given callsign.
func (*Client) Disconnect ¶
func (c *Client) Disconnect()
Disconnect the TCI connection. If this client was created using KeepOpen, the automatic retry stops and the client stays disconnected.
func (*Client) Drive ¶
Drive reads the output power in percent. Starting from TCI version 1.5, this command affects TRX 0.
func (*Client) ECoderSwitchChannel ¶
ECoderSwitchChannel reads which channel is assigned to the given E-Coder.
func (*Client) ECoderSwitchRX ¶
ECoderSwitchRX reads which TRX is assigned to the given E-Coder.
func (*Client) IQSampleRate ¶
func (c *Client) IQSampleRate() (IQSampleRate, error)
IQSampleRate reads the sample rate for IQ data.
func (Client) Notify ¶
func (n Client) Notify(listener interface{})
Notify registers the given listener. The listener is then notified about incoming messages.
func (*Client) RXANCEnable ¶ added in v0.3.0
RXANCEnable reads the given TRX's automatic noise cancellation enable state. (since TCI 1.6)
func (*Client) RXANFEnable ¶ added in v0.3.0
RXANFEnable reads the given TRX's automatic notch filter enable state. (since TCI 1.6)
func (*Client) RXAPFEnable ¶ added in v0.3.0
RXANFEnable reads the given TRX's analogue peak filter enable state. (since TCI 1.6)
func (*Client) RXBalance ¶
RXBalance reads the given TRX's channel balance in dB (range from -40dB to 40dB).
func (*Client) RXBinEnable ¶ added in v0.3.0
RXBinEnable reads the given TRX's pseudo stereo enable state. (since TCI 1.6)
func (*Client) RXChannelEnable ¶
RXChannelEnable reads the enable state of the given TRX's additional RX channel with the given index.
func (*Client) RXDSEEnable ¶ added in v0.3.0
RXDSEEnable reads the given TRX's digital surround sound effect enable state. (since TCI 1.6)
func (*Client) RXFilterBand ¶
RXFilterBand reads the IF filter boundaries of the given TRX.
func (*Client) RXNBEnable ¶ added in v0.3.0
RXNBEnable reads the given TRX's noise blanker enable state. (since TCI 1.6)
func (*Client) RXNBParams ¶ added in v0.3.0
RXNBParams reads the given TRX's noise blanker parameters. (since TCI 1.6)
func (*Client) RXNFEnable ¶ added in v0.3.0
RXNFEnable reads the given TRX's band notch filters enable state. (since TCI 1.6)
func (*Client) RXNREnable ¶ added in v0.3.0
RXNREnable reads the given TRX's noise reduction enable state. (since TCI 1.6)
func (*Client) RXSMeter ¶
RXSMeter reads the signal level of the given TRX's RX channel with the given index.
func (*Client) RXVolume ¶
RXVolume reads the given TRX's channel volume in dB (range from -60dB to 0dB).
func (*Client) Ready ¶
func (c *Client) Ready()
Ready handles the READY; message coming from the TCI host. Should not be called from outside!
func (*Client) SendCWMacro ¶
SendCWMacro sends the given text, which may contain macro characters <. >, and | to change the speed and send abbreviations.
func (*Client) SendCWMessage ¶
SendCWMessage sends the given text, allowing to changes the callsign as long as it was not transmitted yet.
func (*Client) SendCallsign ¶
SendCallsign changes the callsign of a previous SendCWMessage call, if the callsign was not transmitted yet.
func (*Client) SendTXAudio ¶
func (c *Client) SendTXAudio(trx int, sampleRate AudioSampleRate, samples []float32) error
SendTXAudio sends the given samples as reply to a TXChrono message. The samples need to be in stereo, i.e. channel 1 and channel 2 interleaved.
func (*Client) SetAudioSampleRate ¶
func (c *Client) SetAudioSampleRate(sampleRate AudioSampleRate) error
SetAudioSampleRate sets sample rate for Audio data.
func (*Client) SetCTCSSEnable ¶
SetCTCSSEnable enables CTCSS for the given TRX.
func (*Client) SetCTCSSLevel ¶
SetCTCSSLevel sets the given TRX's CTCSS subtone level for transmitting in percent.
func (*Client) SetCTCSSMode ¶
SetCTCSSMode sets the CTCSS mode of the given TRX.
func (*Client) SetCTCSSRXTone ¶
SetCTCSSRXTone sets the given TRX's CTCSS subtone for receiving.
func (*Client) SetCTCSSTXTone ¶
SetCTCSSTXTone sets the given TRX's CTCSS subtone for transmitting.
func (*Client) SetCWMacrosDelay ¶
SetCWMacrosDelay sets the delay between keying the TRX and transmitting a CW macros in milliseconds.
func (*Client) SetCWMacrosSpeed ¶
SetCWMacrosSpeed sets the speed in WPM for CW macros.
func (*Client) SetCWTerminal ¶ added in v0.3.0
SetCWTerminal enables/disables the terminal mode for CW transmission (since TCI 1.5)
func (*Client) SetDrive ¶
SetDrive sets the output power in percent. Starting from TCI version 1.5, this command affects TRX 0.
func (*Client) SetECoderSwitchChannel ¶
SetECoderSwitchChannel assigns the given channel's control to the given E-Coder.
func (*Client) SetECoderSwitchRX ¶
SetECoderSwitchRX assigns the given TRX's control to the given E-Coder.
func (*Client) SetIQSampleRate ¶
func (c *Client) SetIQSampleRate(sampleRate IQSampleRate) error
SetIQSampleRate sets sample rate for IQ data.
func (*Client) SetRITEnable ¶
SetRITEnable enables the RIT of the given TRX.
func (*Client) SetRITOffset ¶
SetRITOffset sets the RIT offset in Hz for the given TRX.
func (*Client) SetRXANCEnable ¶ added in v0.3.0
SetRXANCEnable enables/disables the given TRX's automatic noise cancellation. (since TCI 1.6)
func (*Client) SetRXANFEnable ¶ added in v0.3.0
SetRXANFEnable enables/disables the given TRX's automatic notch filter. (since TCI 1.6)
func (*Client) SetRXAPFEnable ¶ added in v0.3.0
SetRXAPFEnable enables/disables the given TRX's analogue peak filter. (since TCI 1.6)
func (*Client) SetRXBalance ¶
SetRXBalance sets the given TRX's channel balance in dB (range from -40dB to 40dB).
func (*Client) SetRXBinEnable ¶ added in v0.3.0
SetRXBinEnable enables/disables the given TRX's pseudo stereo for CW. (since TCI 1.6)
func (*Client) SetRXChannelEnable ¶
SetRXChannelEnable enables the given TRX's additional RX channel with the given index.
func (*Client) SetRXDSEEnable ¶ added in v0.3.0
SetRXDSEEnable enables/disables the given TRX's digital surround sound effect. (since TCI 1.6)
func (*Client) SetRXEnable ¶
SetRXEnable enables the RX of the given TRX.
func (*Client) SetRXFilterBand ¶
SetRXFilterBand sets the IF filter boundaries of the given TRX using the given limit frequencies in Hz.
func (*Client) SetRXNBEnable ¶ added in v0.3.0
SetRXNBEnable enables/disables the given TRX's noise blanker. (since TCI 1.6)
func (*Client) SetRXNBParams ¶ added in v0.3.0
SetRXNBParams sets the given TRX's noise blanker parameters. (since TCI 1.6)
func (*Client) SetRXNFEnable ¶ added in v0.3.0
SetRXNFEnable enables/disables the given TRX's band notch filters. (since TCI 1.6)
func (*Client) SetRXNREnable ¶ added in v0.3.0
SetRXNREnable enables/disables the given TRX's noise reduction. (since TCI 1.6)
func (*Client) SetRXSMeter ¶
SetRXSMeter sets the signal level of the given TRX's RX channel with the given index.
func (*Client) SetRXSensorsEnable ¶ added in v0.3.0
SetRXSensorsEnable enables/disables the sharing of receiver sensor readings with the given interval in milliseconds. (since TCI 1.5)
func (*Client) SetRXVolume ¶
SetRXVolume sets the given TRX's channel volume in dB (range from -60dB to 0dB).
func (*Client) SetSplitEnable ¶
SetSplitEnable enables the split mode of the given TRX. When split mode is enabled, VFOB is used for transmitting.
func (*Client) SetSquelchEnable ¶
SetSquelchEnable enables the given TRX's squelch.
func (*Client) SetSquelchLevel ¶
SetSquelchLevel sets given TRX's squelch threshold in dB (range from -140dB to 0dB).
func (*Client) SetTRXDrive ¶ added in v0.3.0
SetTRXDrive sets the output power for a certain TRX in percent. (since TCI 1.5)
func (*Client) SetTRXTuneDrive ¶ added in v0.3.0
SetTRXTuneDrive sets the output power for tuning for a certain TRX in percent. (since TCI 1.5)
func (*Client) SetTX ¶
func (c *Client) SetTX(trx int, enabled bool, source SignalSource) error
SetTX enables the TX of the given TRX using the given signal source. Use "" (SignalSourceDefault) if you want to use the default source for the current mode.
func (*Client) SetTXSensorsEnable ¶ added in v0.3.0
SetTXSensorsEnable enables/disables the sharing of transmitter sensor readings with the given interval in milliseconds. (since TCI 1.5)
func (*Client) SetTimeout ¶
SetTimeout sets the duration to wait for the reply to a command.
func (*Client) SetTuneDrive ¶
SetTuneDrive sets the output power for tuning in percent.
func (*Client) SetVFOFrequency ¶
SetVFOFrequency sets the tuning frequency of the given TRX's vfo.
func (*Client) SetXITEnable ¶
SetXITEnable enables the XIT of the given TRX.
func (*Client) SetXITOffset ¶
SetXITOffset sets the XIT offset in Hz for the given TRX.
func (*Client) SplitEnable ¶
SplitEnable reads the split mode enable state of the given TRX. When split mode is enabled, VFOB is used for transmitting.
func (*Client) SquelchEnable ¶
SquelchEnable reads the enable state of the given TRX's squelch.
func (*Client) SquelchLevel ¶
SquelchLevel reads the given TRX's squelch threshold in dB (range from -140dB to 0dB).
func (*Client) StartAudio ¶
StartAudio starts the transmission of audio data for the given TRX.
func (*Client) TRXDrive ¶ added in v0.3.0
TRXDrive reads the output power of a certain TRX in percent. (since TCI 1.5)
func (*Client) TRXTuneDrive ¶ added in v0.3.0
TRXTuneDrive reads the output power for tuning of a certain TRX in percent. (since TCI 1.5)
func (*Client) VFOFrequency ¶
VFOFrequency reads the tuning frequency of the given TRX's vfo.
func (*Client) WhenDisconnected ¶
func (c *Client) WhenDisconnected(f func())
WhenDisconnected calls the given function when the client gets disconnected.
type ConnectionListener ¶
type ConnectionListener interface {
Connected(connected bool)
}
ConnectionListener is notified when the TCI connection is established or disconnected.
type ConnectionListenerFunc ¶
type ConnectionListenerFunc func(bool)
ConnectionListenerFunc wraps a function with the ConnectionListener interface.
func (ConnectionListenerFunc) Connected ¶
func (f ConnectionListenerFunc) Connected(connected bool)
Implements the ConnectionListener interface.
type DDSListener ¶
A DDSListener is notified when a DDS message is received from the TCI server.
type DeviceInfo ¶
type DeviceInfo struct { DeviceName string ProtocolName string ProtocolVersion string MinVFOFrequency int MaxVFOFrequency int MinIFFrequency int MaxIFFrequency int TRXCount int ChannelCount int RXOnly bool Modes []Mode }
DeviceInfo contains the basic information about the SunSDR device which are transmitted when the TCI connection is established. This information cannot be requested through TCI, so it is automatically collected by the client and provided through this type.
func (*DeviceInfo) SetChannelCount ¶
func (d *DeviceInfo) SetChannelCount(count int)
SetChannelCount handles the CHANNEL_COUNT message.
func (*DeviceInfo) SetDeviceName ¶
func (d *DeviceInfo) SetDeviceName(name string)
SetDeviceName handles the DEVICE message.
func (*DeviceInfo) SetIFLimits ¶
func (d *DeviceInfo) SetIFLimits(min int, max int)
SetIFLimits handles the IF_LIMITS message.
func (*DeviceInfo) SetModes ¶
func (d *DeviceInfo) SetModes(modes []Mode)
SetModes handles the MODULATIONS_LIST message.
func (*DeviceInfo) SetProtocol ¶
func (d *DeviceInfo) SetProtocol(name string, version string)
SetProtocol handles the PROTOCOL message.
func (*DeviceInfo) SetRXOnly ¶
func (d *DeviceInfo) SetRXOnly(value bool)
SetRXOnly handles the RECEIVE_ONLY message.
func (*DeviceInfo) SetTRXCount ¶
func (d *DeviceInfo) SetTRXCount(count int)
SetTRXCount handles the TRX_COUNT message.
func (*DeviceInfo) SetVFOLimits ¶
func (d *DeviceInfo) SetVFOLimits(min int, max int)
SetVFOLimits handles the VFO_LIMITS message.
type DeviceNameListener ¶
type DeviceNameListener interface {
SetDeviceName(name string)
}
A DeviceNameListener is notified when a DEVICE message is received from the TCI server.
type DriveListener ¶
type DriveListener interface {
SetDrive(percent int)
}
A DriveListener is notified when a DRIVE message is received from the TCI server.
type ECoderSwitchChannelListener ¶
A ECoderSwitchChannelListener is notified when a ECODER_SWITCH_CHANNEL message is received from the TCI server.
type ECoderSwitchRXListener ¶
A ECoderSwitchRXListener is notified when a EXODER_SWITCH_RX message is received from the TCI server.
type IFLimitsListener ¶
type IFLimitsListener interface {
SetIFLimits(min, max int)
}
An IFLimitsListener is notified when an IF_LIMITS message is received from the TCI server.
type IFListener ¶
An IFListener is notified when an IF_LIMITS message is received from the TCI server.
type IQDataListener ¶
type IQDataListener interface {
IQData(trx int, sampleRate IQSampleRate, data []float32)
}
A IQDataListener is notified when IQ data is received from the TCI server.
type IQSampleRate ¶
type IQSampleRate int
IQSampleRate represents the sample rate for IQ data in samples per second.
type IQSampleRateListener ¶
type IQSampleRateListener interface {
SetIQSampleRate(sampleRate IQSampleRate)
}
A IQSampleRateListener is notified when a IQ_SAMPLERATE message is received from the TCI server.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message represents a message that is exchanged between the TCI server and a client.
func NewCommandMessage ¶ added in v0.2.1
NewCommandMessage returns a new message with the given name and the given arguments that does not require a response.
func NewRequestMessage ¶ added in v0.2.1
NewRequestMessage returns a new message with the given name and the given arguments that requires a response.
func ParseTextMessage ¶
ParseMessage interprets the given string as a TCI message.
type MessageListener ¶
type MessageListener interface {
Message(msg Message)
}
MessageListener is notified when any text message is received from the TCI server.
type ModeListener ¶
A ModeListener is notified when a MODULATION message is received from the TCI server.
type ModesListener ¶
type ModesListener interface {
SetModes(modes []Mode)
}
A ModesListener is notified when a MODULATIONS_LIST message is received from the TCI server.
type MuteListener ¶
type MuteListener interface {
SetMute(muted bool)
}
A MuteListener is notified when a MUTE message is received from the TCI server.
type ProtocolListener ¶
A ProtocolListener is notified when a PROTOCOL message is received from the TCI server.
type RITEnableListener ¶
A RITEnableListener is notified when a RIT_ENABLE message is received from the TCI server.
type RITOffsetListener ¶
A RITOffsetListener is notified when a RIT_OFFSET message is received from the TCI server.
type RXANCEnableListener ¶ added in v0.3.0
A RXANCEnableListener is notified when a RX_ANC_ENABLE message is received from the TCI server. (since TCI 1.6)
type RXANFEnableListener ¶ added in v0.3.0
A RXANFEnableListener is notified when a RX_ANF_ENABLE message is received from the TCI server. (since TCI 1.6)
type RXAPFEnableListener ¶ added in v0.3.0
A RXAPFEnableListener is notified when a RX_APF_ENABLE message is received from the TCI server. (since TCI 1.6)
type RXAudioListener ¶
type RXAudioListener interface {
RXAudio(trx int, sampleRate AudioSampleRate, samples []float32)
}
A RXAudioListener is notified when RX audio data is received from the TCI server.
type RXBalanceListener ¶
A RXBalanceListener is notified when a RX_BALANCE message is received from the TCI server.
type RXBinEnableListener ¶ added in v0.3.0
A RXBinEnableListener is notified when a RX_BIN_ENABLE message is received from the TCI server. (since TCI 1.6)
type RXChannelEnableListener ¶
A RXChannelEnableListener is notified when a RX_CHANNEL_ENABLE message is received from the TCI server.
type RXDSEEnableListener ¶ added in v0.3.0
A RXDSEEnableListener is notified when a RX_DSE_ENABLE message is received from the TCI server. (since TCI 1.6)
type RXEnableListener ¶
A RXEnableListener is notified when a RX_ENABLE message is received from the TCI server.
type RXFilterBandListener ¶
A RXFilterBandListener is notified when a RX_FILTER_BAND message is received from the TCI server.
type RXMuteListener ¶
A RXMuteListener is notified when a RX_MUTE message is received from the TCI server.
type RXNBEnableListener ¶ added in v0.3.0
A RXNBEnableListener is notified when a RX_NB_ENABLE message is received from the TCI server. (since TCI 1.6)
type RXNBParamsListener ¶ added in v0.3.0
A RXNBParamsListener is notified when a RX_NB_PARAM message is received from the TCI server. (since TCI 1.6)
type RXNFEnableListener ¶ added in v0.3.0
A RXNFEnableListener is notified when a RX_NF_ENABLE message is received from the TCI server. (since TCI 1.6)
type RXNREnableListener ¶ added in v0.3.0
A RXNREnableListener is notified when a RX_NR_ENABLE message is received from the TCI server. (since TCI 1.6)
type RXOnlyListener ¶
type RXOnlyListener interface {
SetRXOnly(value bool)
}
A RXOnlyListener is notified when a RECEIVE_ONLY message is received from the TCI server.
type RXSMeterListener ¶
A RXSMeterListener is notified when a RX_SMETER message is received from the TCI server.
type RXSensorsListener ¶ added in v0.3.0
A RXSensorsListener is notified when a RX_SENSORS message is received from the TCI server. (since TCI 1.5)
type RXVolumeListener ¶
A RXVolumeListener is notified when a RX_VOLUME message is received from the TCI server.
type ReadyListener ¶
type ReadyListener interface {
Ready()
}
A ReadyListener is notified when a READY message is received from the TCI server.
type SignalSource ¶
type SignalSource string
SignalSource represents the source of the TX audio signal.
type SplitEnableListener ¶
A SplitEnableListener is notified when a SPLIT_ENABLE message is received from the TCI server.
type SquelchEnableListener ¶
A SquelchEnableListener is notified when a SQL_ENABLE message is received from the TCI server.
type SquelchLevelListener ¶
type SquelchLevelListener interface {
SetSquelchLevel(dB int)
}
A SquelchLevelListener is notified when a SQL_LEVEL message is received from the TCI server.
type StartAudioListener ¶
type StartAudioListener interface {
StartAudio(trx int)
}
A StartAudioListener is notified when a AUDIO_START message is received from the TCI server.
type StartIQListener ¶
type StartIQListener interface {
StartIQ(trx int)
}
A StartIQListener is notified when a IQ_START message is received from the TCI server.
type StartListener ¶
type StartListener interface {
Start()
}
A StartListener is notified when a START message is received from the TCI server.
type StopAudioListener ¶
type StopAudioListener interface {
StopAudio(trx int)
}
A StopAudioListener is notified when a AUDIO_STOP message is received from the TCI server.
type StopIQListener ¶
type StopIQListener interface {
StopIQ(trx int)
}
A StopIQListener is notified when a IQ_STOP message is received from the TCI server.
type StopListener ¶
type StopListener interface {
Stop()
}
A StopListener is notified when a STOP message is received from the TCI server.
type TRXCountListener ¶
type TRXCountListener interface {
SetTRXCount(count int)
}
A TRXCountListener is notified when a TRX_COUNT message is received from the TCI server.
type TRXDriveListener ¶ added in v0.3.0
A TRXDriveListener is notified when a DRIVE message for a certain TRX is received from the TCI server. (since TCI 1.5)
type TRXTuneDriveListener ¶ added in v0.3.0
A TRXTuneDriveListener is notified when a TUNE_DRIVE message for a certain TRX is received from the TCI server.
type TXChronoListener ¶
type TXChronoListener interface {
TXChrono(trx int, sampleRate AudioSampleRate, requestedSampleCount uint32)
}
A TXChronoListener is notified when a TX chrono message is received from the TCI server.
type TXEnableListener ¶
A TXEnableListener is notified when a TX_ENABLE message is received from the TCI server.
type TXFootswitchListener ¶
A TXFootswitchListener is notified when a TX_FOOTSWITCH message is received from the TCI server.
type TXFrequencyListener ¶ added in v0.3.0
A TXFrequencyListener is notified when a TX_FREQUENCY message is received from the TCI server. (since TCI 1.6)
type TXListener ¶
A TXListener is notified when a TRX message is received from the TCI server.
type TXPowerListener ¶
type TXPowerListener interface {
SetTXPower(watts float64)
}
A TXPowerListener is notified when a TX_POWER message is received from the TCI server.
type TXSWRListener ¶
type TXSWRListener interface {
SetTXSWR(ratio float64)
}
A TXSWRListener is notified when a TX_SWR message is received from the TCI server.
type TXSensorsListener ¶ added in v0.3.0
type TXSensorsListener interface {
SetTXSensors(trx int, micdBm float64, txRMS float64, txPeak float64, swr float64)
}
A TXSensorsListener is notified when a TX_SENSORS message is received from the TCI server. (since TCI 1.5)
type TuneDriveListener ¶
type TuneDriveListener interface {
SetTuneDrive(percent int)
}
A TuneDriveListener is notified when a TUNE_DRIVE message is received from the TCI server.
type TuneListener ¶
A TuneListener is notified when a TUNE message is received from the TCI server.
type VFO ¶
type VFO int
VFO represents a VFO in TCI. In the TCI documentation the VFOs area also named "channel".
type VFOFrequencyListener ¶
A VFOFrequencyListener is notified when a VFO message is received from the TCI server.
type VFOLimitsListener ¶
type VFOLimitsListener interface {
SetVFOLimits(min, max int)
}
A VFOLimitsListener is notified when a VFO_LIMITS message is received from the TCI server.
type VolumeListener ¶
type VolumeListener interface {
SetVolume(dB int)
}
A VolumeListener is notified when a VOLUME message is received from the TCI server.
type XITEnableListener ¶
A XITEnableListener is notified when a XIT_ENABLE message is received from the TCI server.
type XITOffsetListener ¶
A XITOffsetListener is notified when a XIT_OFFSET message is received from the TCI server.