diff options
Diffstat (limited to 'src/ConfigParser.cpp')
-rw-r--r-- | src/ConfigParser.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp index d5d1995..73e51dd 100644 --- a/src/ConfigParser.cpp +++ b/src/ConfigParser.cpp @@ -312,6 +312,36 @@ static void parse_configfile( mod_settings.useSoapyOutput = true; } #endif +#if defined(HAVE_LIMESDR) + else if (output_selected == "limesdr") { + auto& outputlime_conf = mod_settings.sdr_device_config; + outputlime_conf.device = pt.Get("limeoutput.device", ""); + outputlime_conf.masterClockRate = pt.GetInteger("limeoutput.master_clock_rate", 0); + outputlime_conf.txgain = pt.GetReal("limeoutput.txgain", 0.0); + outputlime_conf.tx_antenna = pt.Get("limeoutput.tx_antenna", ""); + outputlime_conf.lo_offset = pt.GetReal("limeoutput.lo_offset", 0.0); + outputlime_conf.frequency = pt.GetReal("limeoutput.frequency", 0); + std::string chan = pt.Get("limeoutput.channel", ""); + outputlime_conf.dabMode = mod_settings.dabMode; + outputlime_conf.upsample = pt.GetInteger("limeoutput.upsample", 1); + + if (outputlime_conf.frequency == 0 && chan == "") { + std::cerr << " Lime output enabled, but neither frequency nor channel defined.\n"; + throw std::runtime_error("Configuration error"); + } + else if (outputlime_conf.frequency == 0) { + outputlime_conf.frequency = parseChannel(chan); + } + else if (outputlime_conf.frequency != 0 && chan != "") { + std::cerr << " Lime output: cannot define both frequency and channel.\n"; + throw std::runtime_error("Configuration error"); + } + + outputlime_conf.dpdFeedbackServerPort = pt.GetInteger("limeoutput.dpd_port", 0); + + mod_settings.useLimeOutput = true; + } +#endif #if defined(HAVE_ZEROMQ) else if (output_selected == "zmq") { mod_settings.outputName = pt.Get("zmqoutput.listen", ""); |