diff options
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_impl.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_impl.cpp b/host/lib/usrp/mpmd/mpmd_impl.cpp index 80061ede3..87e911e17 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_impl.cpp @@ -106,11 +106,14 @@ namespace { * number. * \param actual Tuple of 2 integers representing MAJOR.MINOR compat * number. + * \param advice_on_failure A string that is appended to the error message + * when compat number mismatches have occurred. */ void assert_compat_number_throw( const std::string &component, const std::vector<size_t> &expected, - const std::vector<size_t> &actual + const std::vector<size_t> &actual, + const std::string& advice_on_failure="" ) { UHD_ASSERT_THROW(expected.size() == 2); UHD_ASSERT_THROW(actual.size() == 2); @@ -124,20 +127,24 @@ namespace { if (actual[0] != expected[0]) { const std::string err_msg = str(boost::format("%s major compat number mismatch. " - "Expected: %i.%i Actual: %i.%i") + "Expected: %i.%i Actual: %i.%i.%s%s") % component % expected[0] % expected[1] - % actual[0] % actual[1]); + % actual[0] % actual[1] + % (advice_on_failure.empty() ? "" : " ") + % advice_on_failure); UHD_LOG_ERROR("MPMD", err_msg); throw uhd::runtime_error(err_msg); } if (actual[1] < expected[1]) { const std::string err_msg = str(boost::format("%s minor compat number mismatch. " - "Expected: %i.%i Actual: %i.%i") + "Expected: %i.%i Actual: %i.%i.%s%s") % component % expected[0] % expected[1] - % actual[0] % actual[1]); + % actual[0] % actual[1] + % (advice_on_failure.empty() ? "" : " ") + % advice_on_failure); UHD_LOG_ERROR("MPMD", err_msg); throw uhd::runtime_error(err_msg); } @@ -279,7 +286,8 @@ void mpmd_impl::setup_mb( assert_compat_number_throw( "MPM", MPM_COMPAT_NUM, - mb->rpc->request<std::vector<size_t>>("get_mpm_compat_num") + mb->rpc->request<std::vector<size_t>>("get_mpm_compat_num"), + "Please update the version of MPM on your USRP device." ); UHD_LOG_DEBUG("MPMD", "Initializing mboard " << mb_index); |