diff options
author | F5OEO <evaristec@gmail.com> | 2018-12-10 16:51:29 +0000 |
---|---|---|
committer | F5OEO <evaristec@gmail.com> | 2018-12-10 16:51:29 +0000 |
commit | 352ee913f5cefc47d5cd1cf73b5b6a70b5369bef (patch) | |
tree | fc0e965fbb300c85b2d8df4da8d8f1f070aabf49 /src/ConfigParser.cpp | |
parent | e32b0ea9c39330cd3c039aa158599d1011812cf1 (diff) | |
download | dabmod-352ee913f5cefc47d5cd1cf73b5b6a70b5369bef.tar.gz dabmod-352ee913f5cefc47d5cd1cf73b5b6a70b5369bef.tar.bz2 dabmod-352ee913f5cefc47d5cd1cf73b5b6a70b5369bef.zip |
Set minimal init
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 69655b4..8c80513 100644 --- a/src/ConfigParser.cpp +++ b/src/ConfigParser.cpp @@ -307,6 +307,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("soapyoutput.device", ""); + outputlime_conf.masterClockRate = pt.GetInteger("soapyoutput.master_clock_rate", 0); + + outputlime_conf.txgain = pt.GetReal("soapyoutput.txgain", 0.0); + outputlime_conf.tx_antenna = pt.Get("soapyoutput.tx_antenna", ""); + outputlime_conf.lo_offset = pt.GetReal("soapyoutput.lo_offset", 0.0); + outputlime_conf.frequency = pt.GetReal("soapyoutput.frequency", 0); + std::string chan = pt.Get("soapyoutput.channel", ""); + outputlime_conf.dabMode = mod_settings.dabMode; + + if (outputlime_conf.frequency == 0 && chan == "") { + std::cerr << " soapy 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 << " soapy output: cannot define both frequency and channel.\n"; + throw std::runtime_error("Configuration error"); + } + + outputlime_conf.dpdFeedbackServerPort = pt.GetInteger("soapyoutput.dpd_port", 0); + + mod_settings.useLimeOutput = true; + } +#endif #if defined(HAVE_ZEROMQ) else if (output_selected == "zmq") { mod_settings.outputName = pt.Get("zmqoutput.listen", ""); |