summaryrefslogtreecommitdiffstats
path: root/src/DabMod.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-03-16 22:34:05 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-03-16 22:50:55 +0100
commit173f1d8bf78f59320c95148dd21611ea3b6b7153 (patch)
tree1bd242bb737b8d1a3871186b9773fae97ba63db5 /src/DabMod.cpp
parentdef2ae4de143572f10949d18075f1977a861815f (diff)
downloaddabmod-173f1d8bf78f59320c95148dd21611ea3b6b7153.tar.gz
dabmod-173f1d8bf78f59320c95148dd21611ea3b6b7153.tar.bz2
dabmod-173f1d8bf78f59320c95148dd21611ea3b6b7153.zip
Handle master_clock_rate better, add verification
The configuration file supports type and master_clock_rate in the [uhd] section. The device option is still supported. But the master_clock_rate can only be verified if it is set !
Diffstat (limited to 'src/DabMod.cpp')
-rw-r--r--src/DabMod.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index bd83531..fc589ec 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -3,8 +3,10 @@
Her Majesty the Queen in Right of Canada (Communications Research
Center Canada)
- Includes modifications for which no copyright is claimed
- 2012, Matthias P. Braendli, matthias.braendli@mpb.li
+ Copyright (C) 2014
+ Matthias P. Braendli, matthias.braendli@mpb.li
+
+ http://opendigitalradio.org
*/
/*
This file is part of ODR-DabMod.
@@ -413,6 +415,19 @@ int main(int argc, char* argv[])
}
else if (output_selected == "uhd") {
outputuhd_conf.device = pt.get("uhdoutput.device", "");
+ outputuhd_conf.usrpType = pt.get("uhdoutput.type", "");
+ outputuhd_conf.masterClockRate = pt.get<long>("uhdoutput.master_clock_rate", 0);
+
+ if (outputuhd_conf.device.find("master_clock_rate") != std::string::npos) {
+ std::cerr << "Warning:"
+ "setting master_clock_rate in [uhd] device is deprecated !\n";
+ }
+
+ if (outputuhd_conf.device.find("type=") != std::string::npos) {
+ std::cerr << "Warning:"
+ "setting type in [uhd] device is deprecated !\n";
+ }
+
outputuhd_conf.txgain = pt.get("uhdoutput.txgain", 0);
outputuhd_conf.frequency = pt.get<double>("uhdoutput.frequency", 0);
std::string chan = pt.get<std::string>("uhdoutput.channel", "");
@@ -584,7 +599,13 @@ int main(int argc, char* argv[])
fprintf(stderr, " Source: %s\n", inputName.c_str());
fprintf(stderr, "Output\n");
if (useUHDOutput) {
- fprintf(stderr, " UHD, Device: %s\n", outputuhd_conf.device.c_str());
+ fprintf(stderr, " UHD\n"
+ " Device: %s\n"
+ " Type: %s\n"
+ " master_clock_rate: %ld\n",
+ outputuhd_conf.device.c_str(),
+ outputuhd_conf.usrpType.c_str(),
+ outputuhd_conf.masterClockRate);
}
else if (useFileOutput) {
fprintf(stderr, " Name: %s\n", outputName.c_str());