aboutsummaryrefslogtreecommitdiffstats
path: root/src/ConfigParser.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2021-07-08 15:49:23 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2021-11-26 16:51:25 +0100
commit558a210085b61b84e3be5a420d86d2ee6a500c8e (patch)
treecb16ff88132ef9e7c946a4e3f5523f9113cf4aed /src/ConfigParser.cpp
parent22fd7d757f11a6c976d7e711fd46cf2ce3247c44 (diff)
downloaddabmod-558a210085b61b84e3be5a420d86d2ee6a500c8e.tar.gz
dabmod-558a210085b61b84e3be5a420d86d2ee6a500c8e.tar.bz2
dabmod-558a210085b61b84e3be5a420d86d2ee6a500c8e.zip
Add support for BladeRF devices
Many thanks to Steven Rossel for the work he did during his student project.
Diffstat (limited to 'src/ConfigParser.cpp')
-rw-r--r--src/ConfigParser.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp
index 73e51dd..ee7acc3 100644
--- a/src/ConfigParser.cpp
+++ b/src/ConfigParser.cpp
@@ -342,6 +342,36 @@ static void parse_configfile(
mod_settings.useLimeOutput = true;
}
#endif
+
+#if defined(HAVE_BLADERF)
+ else if (output_selected == "bladerf") {
+ auto& outputbladerf_conf = mod_settings.sdr_device_config;
+ outputbladerf_conf.device = pt.Get("bladerfoutput.device", "");
+ outputbladerf_conf.refclk_src = pt.Get("bladerfoutput.refclk_source", "");
+ outputbladerf_conf.txgain = pt.GetReal("bladerfoutput.txgain", 0.0);
+ outputbladerf_conf.frequency = pt.GetReal("bladerfoutput.frequency", 0);
+ outputbladerf_conf.bandwidth = pt.GetReal("bladerfoutput.bandwidth", 0);
+ std::string chan = pt.Get("bladerfoutput.channel", "");
+ outputbladerf_conf.dabMode = mod_settings.dabMode;
+
+ if (outputbladerf_conf.frequency == 0 && chan == "") {
+ std::cerr << " BladeRF output enabled, but neither frequency nor channel defined.\n";
+ throw std::runtime_error("Configuration error");
+ }
+ else if (outputbladerf_conf.frequency == 0) {
+ outputbladerf_conf.frequency = parseChannel(chan);
+ }
+ else if (outputbladerf_conf.frequency != 0 && chan != "") {
+ std::cerr << " BladeRF output: cannot define both frequency and channel.\n";
+ throw std::runtime_error("Configuration error");
+ }
+
+ outputbladerf_conf.dpdFeedbackServerPort = pt.GetInteger("bladerfoutput.dpd_port", 0);
+
+ mod_settings.useBladeRFOutput = true;
+ }
+#endif
+
#if defined(HAVE_ZEROMQ)
else if (output_selected == "zmq") {
mod_settings.outputName = pt.Get("zmqoutput.listen", "");
@@ -354,6 +384,7 @@ static void parse_configfile(
throw std::runtime_error("Configuration error");
}
+
#if defined(HAVE_OUTPUT_UHD)
mod_settings.sdr_device_config.enableSync = (pt.GetInteger("delaymanagement.synchronous", 0) == 1);
mod_settings.sdr_device_config.muteNoTimestamps = (pt.GetInteger("delaymanagement.mutenotimestamps", 0) == 1);
@@ -378,6 +409,7 @@ static void parse_configfile(
#endif
+
/* Read TII parameters from config file */
mod_settings.tiiConfig.enable = pt.GetInteger("tii.enable", 0);
mod_settings.tiiConfig.comb = pt.GetInteger("tii.comb", 0);