Просмотр исходного кода

feat: add driver/uri/deviceArgs backend config plumbing

tags/v0.9.0
Jan Svabenik 1 месяц назад
Родитель
Сommit
ce12ff92b8
4 измененных файлов: 21 добавлений и 5 удалений
  1. +2
    -0
      .gitignore
  2. +9
    -1
      cmd/fmrtx/main.go
  3. +3
    -0
      docs/config.plutosdr.json
  4. +7
    -4
      internal/config/config.go

+ 2
- 0
.gitignore Просмотреть файл

@@ -7,3 +7,5 @@ build/
*.iq
*.raw
*.bak
*.zip
*.exe

+ 9
- 1
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()



+ 3
- 0
docs/config.plutosdr.json Просмотреть файл

@@ -32,6 +32,9 @@
"backend": {
"kind": "pluto",
"device": "usb:",
"driver": "",
"uri": "",
"deviceArgs": {},
"outputPath": "",
"deviceSampleRateHz": 2280000
},


+ 7
- 4
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 {


Загрузка…
Отмена
Сохранить