diff --git a/.gitignore b/.gitignore index 04837f0..fc557ca 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ build/ *.iq *.raw *.bak +*.zip +*.exe diff --git a/cmd/fmrtx/main.go b/cmd/fmrtx/main.go index 069f91e..a25a9b8 100644 --- a/cmd/fmrtx/main.go +++ b/cmd/fmrtx/main.go @@ -153,9 +153,17 @@ func runTXMode(cfg cfgpkg.Config, driver platform.SoapyDriver, autoStart bool, a // OutputDrive controls composite signal level, NOT hardware gain. // Hardware TX gain is always 0 dB (max power). Use external attenuator for power control. soapyCfg := platform.SoapyConfig{ - Driver: cfg.Backend.Device, + Driver: cfg.Backend.Driver, + Device: cfg.Backend.Device, CenterFreqHz: cfg.FM.FrequencyMHz * 1e6, GainDB: 0, // 0 dB = max TX power on PlutoSDR + DeviceArgs: map[string]string{}, + } + if cfg.Backend.URI != "" { + soapyCfg.DeviceArgs["uri"] = cfg.Backend.URI + } + for k, v := range cfg.Backend.DeviceArgs { + soapyCfg.DeviceArgs[k] = v } soapyCfg.SampleRateHz = cfg.EffectiveDeviceRate() diff --git a/docs/config.plutosdr.json b/docs/config.plutosdr.json index 1676050..1cb9738 100644 --- a/docs/config.plutosdr.json +++ b/docs/config.plutosdr.json @@ -32,6 +32,9 @@ "backend": { "kind": "pluto", "device": "usb:", + "driver": "", + "uri": "", + "deviceArgs": {}, "outputPath": "", "deviceSampleRateHz": 2280000 }, diff --git a/internal/config/config.go b/internal/config/config.go index 2f48f6a..768a40a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -50,10 +50,13 @@ type FMConfig struct { } type BackendConfig struct { - Kind string `json:"kind"` - Device string `json:"device"` - OutputPath string `json:"outputPath"` - DeviceSampleRateHz float64 `json:"deviceSampleRateHz"` // actual SDR device rate; 0 = same as compositeRateHz + Kind string `json:"kind"` + Driver string `json:"driver,omitempty"` + Device string `json:"device"` + URI string `json:"uri,omitempty"` + DeviceArgs map[string]string `json:"deviceArgs,omitempty"` + OutputPath string `json:"outputPath"` + DeviceSampleRateHz float64 `json:"deviceSampleRateHz"` // actual SDR device rate; 0 = same as compositeRateHz } type ControlConfig struct {