diff options
-rw-r--r-- | src/ConfigParser.h | 4 | ||||
-rw-r--r-- | src/DabMod.cpp | 21 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/ConfigParser.h b/src/ConfigParser.h index ee961fa..23b0528 100644 --- a/src/ConfigParser.h +++ b/src/ConfigParser.h @@ -37,6 +37,7 @@ #include "output/SDR.h" #include "output/UHD.h" #include "output/Soapy.h" +#include "output/Lime.h" #define ZMQ_INPUT_MAX_FRAME_QUEUE 500 @@ -49,6 +50,7 @@ struct mod_settings_t { bool fileOutputShowMetadata = false; bool useUHDOutput = false; bool useSoapyOutput = false; + bool useLimeOutput = false; size_t outputRate = 2048000; size_t clockRate = 0; @@ -82,7 +84,7 @@ struct mod_settings_t { // Settings for the OFDM windowing size_t ofdmWindowOverlap = 0; -#if defined(HAVE_OUTPUT_UHD) || defined(HAVE_SOAPYSDR) +#if defined(HAVE_OUTPUT_UHD) || defined(HAVE_SOAPYSDR) || defined(HAVE_LIMESDR) Output::SDRDeviceConfig sdr_device_config; #endif diff --git a/src/DabMod.cpp b/src/DabMod.cpp index f804512..a217bfe 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -146,6 +146,14 @@ static void printModSettings(const mod_settings_t& mod_settings) mod_settings.sdr_device_config.masterClockRate << "\n"; } #endif +#if defined(HAVE_LIMESDR) + else if (mod_settings.useLimeOutput) { + ss << " LimeSDR\n" + " Device: " << mod_settings.sdr_device_config.device << "\n" << + " master_clock_rate: " << + mod_settings.sdr_device_config.masterClockRate << "\n"; + } +#endif else if (mod_settings.useZeroMQOutput) { ss << " ZeroMQ\n" << " Listening on: " << mod_settings.outputName << "\n" << @@ -229,6 +237,16 @@ static shared_ptr<ModOutput> prepare_output( rcs.enrol((Output::SDR*)output.get()); } #endif +#if defined(HAVE_LIMESDR) + else if (s.useLimeOutput) { + /* We normalise the same way as for the UHD output */ + s.normalise = 1.0f / normalise_factor; + s.sdr_device_config.sampleRate = s.outputRate; + auto limedevice = make_shared<Output::Lime>(s.sdr_device_config); + output = make_shared<Output::SDR>(s.sdr_device_config, limedevice); + rcs.enrol((Output::SDR*)output.get()); + } +#endif #if defined(HAVE_ZEROMQ) else if (s.useZeroMQOutput) { /* We normalise the same way as for the UHD output */ @@ -278,7 +296,8 @@ int launch_modulator(int argc, char* argv[]) if (not (mod_settings.useFileOutput or mod_settings.useUHDOutput or mod_settings.useZeroMQOutput or - mod_settings.useSoapyOutput)) { + mod_settings.useSoapyOutput or + mod_settings.useLimeOutput)) { throw std::runtime_error("Configuration error: Output not specified"); } |