diff options
Diffstat (limited to 'gr-uhd/lib/utils.cc')
-rw-r--r-- | gr-uhd/lib/utils.cc | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/gr-uhd/lib/utils.cc b/gr-uhd/lib/utils.cc index ddc36eb99..5d40c4fff 100644 --- a/gr-uhd/lib/utils.cc +++ b/gr-uhd/lib/utils.cc @@ -25,13 +25,32 @@ #include <iostream> #include <cmath> -void do_samp_rate_error_message(double target_rate, double actual_rate){ +void do_samp_rate_error_message( + double target_rate, + double actual_rate, + const std::string &xx +){ static const double max_allowed_error = 1.0; //Sps if (std::abs(target_rate - actual_rate) > max_allowed_error){ std::cerr << boost::format( - "The hardware does not support the requested sample rate:\n" + "Warning: The hardware does not support the requested %s sample rate:\n" " Target sample rate: %f MSps\n" " Actual sample rate: %f MSps\n" - ) % (target_rate/1e6) % (actual_rate/1e6) << std::endl; + ) % xx % (target_rate/1e6) % (actual_rate/1e6) << std::endl; + } +} + +void do_tune_freq_error_message( + double target_freq, + double actual_freq, + const std::string &xx +){ + static const double max_allowed_error = 1.0; //Hz + if (std::abs(target_freq - actual_freq) > max_allowed_error){ + std::cerr << boost::format( + "Warning: The hardware does not support the requested %s frequency:\n" + " Target frequency: %f MHz\n" + " Actual frequency: %f MHz\n" + ) % xx % (target_freq/1e6) % (actual_freq/1e6) << std::endl; } } |