edge

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyFreq        = errors.New("frequency cannot be empty")
	ErrEmptySampleRate  = errors.New("samping rate cannot be empty")
	ErrEmptyReampleRate = errors.New("resamping rate cannot be empty")
)

Functions

func CaptureAudio

func CaptureAudio(ctx context.Context, config *FmConfig, publisher message.Publisher, logger common.EdgeLogrus) error

func CaptureIQ

func CaptureIQ(ctx context.Context, config *IqConfig, publisher message.Publisher, logger common.EdgeLogrus) error

func DeregisterDevice

func DeregisterDevice(ctx context.Context, kv jetstream.KeyValue, sdrType common.SDRType, deviceName string) error

func ForwardIQ added in v0.2.0

func ForwardIQ(ctx context.Context, config *ForwardConfig, logger common.EdgeLogrus, conn *grpc.ClientConn) error

func RegisterDevice

func RegisterDevice(ctx context.Context, conn *nats.Conn, kv jetstream.KeyValue, sdrType common.SDRType, deviceName string, deviceInfo common.Device) (*nats.Subscription, error)

func WatchDevice

func WatchDevice(ctx context.Context, conn *nats.Conn, kv jetstream.KeyValue, sdrType common.SDRType, deviceName string, logger common.EdgeLogrus) (*nats.Subscription, chan common.Device, error)

Types

type Config

type Config struct {
	Fm      *FmConfig      `mapstructure:"fm"`
	Iq      *IqConfig      `mapstructure:"iq"`
	Forward *ForwardConfig `mapstructure:"forward"`
}

type DeviceConfig

type DeviceConfig struct {
	Name      string
	Latitude  float32
	Longitude float32
}

type FmConfig

type FmConfig struct {
	Device  *DeviceConfig   `mapstructure:"device"`
	Rtlsdr  *RtlsdrFmConfig `mapstructure:"rtlsdr"`
	Nats    *NatsConfig     `mapstructure:"nats"`
	Logging *LoggingConfig  `mapstructure:"logging"`
}

func NewFmConfig

func NewFmConfig() (*FmConfig, error)

type ForwardConfig added in v0.2.0

type ForwardConfig struct {
	Device  *DeviceConfig   `mapstructure:"device"`
	Rtlsdr  *RtlsdrIqConfig `mapstructure:"rtlsdr"`
	Grpc    *GrpcConfig     `mapstructure:"grpc"`
	Nats    *NatsConfig     `mapstructure:"nats"`
	Logging *LoggingConfig  `mapstructure:"logging"`
}

func NewForwardConfig added in v0.2.0

func NewForwardConfig() (*ForwardConfig, error)

type GrpcConfig added in v0.2.0

type GrpcConfig struct {
	Target string
}

type IqConfig

type IqConfig struct {
	Device  *DeviceConfig   `mapstructure:"device"`
	Rtlsdr  *RtlsdrIqConfig `mapstructure:"rtlsdr"`
	Nats    *NatsConfig     `mapstructure:"nats"`
	Logging *LoggingConfig  `mapstructure:"logging"`
}

func NewIqConfig

func NewIqConfig() (*IqConfig, error)

type LoggingConfig

type LoggingConfig struct {
	Level string
}

type NatsConfig

type NatsConfig struct {
	Url     string
	Subject string
}

type RtlsdrFmConfig

type RtlsdrFmConfig struct {
	Freq         string
	SampleRate   string
	ResampleRate string
	Rpc          *RtlsdrRpcConfig `mapstructure:"rpc"`
}

type RtlsdrIqConfig

type RtlsdrIqConfig struct {
	Freq       string
	SampleRate string
	Rpc        *RtlsdrRpcConfig `mapstructure:"rpc"`
}

type RtlsdrRpcConfig

type RtlsdrRpcConfig struct {
	ServerAddr string
	ServerPort string
}

Jump to

Keyboard shortcuts

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