summaryrefslogtreecommitdiffstats
path: root/src/OutputUHD.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-03-09 20:36:23 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-03-09 20:36:23 +0100
commitcf822e376d64144b224cb22b151e9e1a8a7c2f98 (patch)
treed5a8d0c6989b5175873d0897e543098f90fbd1d0 /src/OutputUHD.cpp
parentf87e51d1ef197a9bc82bf34dc8ab73d4d4186569 (diff)
downloaddabmod-cf822e376d64144b224cb22b151e9e1a8a7c2f98.tar.gz
dabmod-cf822e376d64144b224cb22b151e9e1a8a7c2f98.tar.bz2
dabmod-cf822e376d64144b224cb22b151e9e1a8a7c2f98.zip
OutputUHD fails if sample rate cannot be set
Diffstat (limited to 'src/OutputUHD.cpp')
-rw-r--r--src/OutputUHD.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/OutputUHD.cpp b/src/OutputUHD.cpp
index cc1afd5..5e66fb3 100644
--- a/src/OutputUHD.cpp
+++ b/src/OutputUHD.cpp
@@ -91,6 +91,11 @@ OutputUHD::OutputUHD(
myUsrp->set_tx_rate(mySampleRate);
MDEBUG("OutputUHD:Actual TX Rate: %f Msps...\n", myUsrp->get_tx_rate());
+ if (mySampleRate != myUsrp->get_tx_rate()) {
+ MDEBUG("OutputUHD: Cannot set sample\n");
+ throw std::runtime_error("Cannot set USRP sample rate. Aborted.");
+ }
+
//set the centre frequency
MDEBUG("OutputUHD:Setting freq to %f...\n", myFrequency);
myUsrp->set_tx_freq(myFrequency);