Versions in this module Expand all Collapse all v0 v0.1.0 Mar 27, 2026 Changes in this version + var ErrClientClosed = errors.New("sdrconnect: client closed") + var ErrGetTimeout = errors.New("sdrconnect: get_property timed out") + type BinaryFrame struct + Payload []byte + Type FrameType + type Client struct + func NewClient(cfg *Config, logger *slog.Logger) *Client + func (c *Client) Binary() <-chan BinaryFrame + func (c *Client) Close() error + func (c *Client) Connect(ctx context.Context) error + func (c *Client) Connected() bool + func (c *Client) Done() <-chan struct{} + func (c *Client) Send(ctx context.Context, env Envelope) error + func (c *Client) Text() <-chan Envelope + type Config struct + Host string + Port int + type DemodMode string + const DemodAM + const DemodCW + const DemodLSB + const DemodNFM + const DemodSAM + const DemodUSB + const DemodWFM + type Envelope struct + EventType EventType + Property PropertyName + Value string + func NewGetProperty(prop PropertyName) Envelope + func NewSetDemodulator(mode DemodMode) Envelope + func NewSetProperty(prop PropertyName, value string) Envelope + func NewStartRecording(rt RecordingType) Envelope + func NewStopRecording() Envelope + func NewStreamControl(event EventType, enable bool) Envelope + type EventType string + const EventApplyDeviceProfile + const EventAudioStreamEnable + const EventDeviceStreamEnable + const EventGetProperty + const EventGetPropertyResponse + const EventIQStreamEnable + const EventPropertyChanged + const EventSelectedDevice + const EventSelectedDeviceSerial + const EventSetProperty + const EventSpectrumEnable + const EventStartRecording + const EventStopRecording + type FrameType uint16 + const FrameAudio + const FrameIQ + const FrameSpectrum + type Properties struct + func NewProperties(ctx context.Context, client *Client, logger *slog.Logger) *Properties + func (p *Properties) GetCenterFrequency(ctx context.Context) (uint64, error) + func (p *Properties) GetDemodulator(ctx context.Context) (DemodMode, error) + func (p *Properties) GetFilterBandwidth(ctx context.Context) (int, error) + func (p *Properties) GetLNAState(ctx context.Context) (int, error) + func (p *Properties) GetLNAStateMax(ctx context.Context) (int, error) + func (p *Properties) GetLNAStateMin(ctx context.Context) (int, error) + func (p *Properties) GetOverload(ctx context.Context) (bool, error) + func (p *Properties) GetProperty(ctx context.Context, name PropertyName) (string, error) + func (p *Properties) GetSignalPower(ctx context.Context) (float64, error) + func (p *Properties) GetSignalSNR(ctx context.Context) (float64, error) + func (p *Properties) GetVFOFrequency(ctx context.Context) (uint64, error) + func (p *Properties) SetAGCEnable(ctx context.Context, enable bool) error + func (p *Properties) SetAGCThreshold(ctx context.Context, db int) error + func (p *Properties) SetAudioMute(ctx context.Context, mute bool) error + func (p *Properties) SetAudioVolume(ctx context.Context, percent int) error + func (p *Properties) SetCenterFrequency(ctx context.Context, hz uint64) error + func (p *Properties) SetDemodulator(ctx context.Context, mode DemodMode) error + func (p *Properties) SetFilterBandwidth(ctx context.Context, hz int) error + func (p *Properties) SetLNAState(ctx context.Context, state int) error + func (p *Properties) SetNoiseReductionEnable(ctx context.Context, enable bool) error + func (p *Properties) SetNoiseReductionStrength(ctx context.Context, strength int) error + func (p *Properties) SetProperty(ctx context.Context, name PropertyName, value string) error + func (p *Properties) SetSquelchEnable(ctx context.Context, enable bool) error + func (p *Properties) SetSquelchThreshold(ctx context.Context, db int) error + func (p *Properties) SetVFOFrequency(ctx context.Context, hz uint64) error + func (p *Properties) Subscribe() <-chan Envelope + type PropertyName string + const PropAGCEnable + const PropAGCThreshold + const PropAMLowcutFrequency + const PropAudioFilter + const PropAudioLimiters + const PropAudioMute + const PropAudioVolumePercent + const PropCanControl + const PropCenterFrequency + const PropDemodMaxBandwidth + const PropDemodulator + const PropFilterBandwidth + const PropLNAState + const PropLNAStateMax + const PropLNAStateMin + const PropNFMDeemphasisEnable + const PropNFMLowcutFrequency + const PropNoiseReductionEnable + const PropNoiseReductionStrength + const PropOverload + const PropRDSEnable + const PropRDSPI + const PropRDSPS + const PropSSBLowcutFrequency + const PropSampleRate + const PropSignalPower + const PropSignalSNR + const PropSpectrumBase + const PropSpectrumRefLevel + const PropSquelchEnable + const PropSquelchThreshold + const PropStarted + const PropVFOFrequency + const PropWFMStereo + const PropWFMStereoEnable + type RecordingType string + const RecordingAudio + const RecordingCompressedAudio + const RecordingIQ + type Streamer struct + func NewStreamer(ctx context.Context, c *Client, logger *slog.Logger) *Streamer + func (s *Streamer) Close() + func (s *Streamer) DisableAudio(ctx context.Context) error + func (s *Streamer) DisableDeviceStream(ctx context.Context) error + func (s *Streamer) DisableIQ(ctx context.Context) error + func (s *Streamer) DisableSpectrum(ctx context.Context) error + func (s *Streamer) EnableAudio(ctx context.Context) error + func (s *Streamer) EnableDeviceStream(ctx context.Context) error + func (s *Streamer) EnableIQ(ctx context.Context) error + func (s *Streamer) EnableSpectrum(ctx context.Context) error + func (s *Streamer) LatestAudio() []byte + func (s *Streamer) LatestIQ() []byte + func (s *Streamer) LatestSpectrum() []byte + func (s *Streamer) StartRecording(ctx context.Context, rt RecordingType) error + func (s *Streamer) StopRecording(ctx context.Context) error