/*********************************************************************** * Wrapper routines with nice try/catch + print **********************************************************************/ void uhd::usrp::apply_tx_fe_corrections( //overloading to work according to rfnoc tree struct property_tree::sptr sub_tree, //starts at mboards/x const uhd::fs_path db_path, const uhd::fs_path tx_fe_corr_path, const double lo_freq //actual lo freq ){ boost::mutex::scoped_lock l(corrections_mutex); try{ apply_fe_corrections( sub_tree, db_path + "/tx_eeprom", tx_fe_corr_path + "/iq_balance/value", "tx_iq_cal_v0.2_", lo_freq ); apply_fe_corrections( sub_tree, db_path + "/tx_eeprom", tx_fe_corr_path + "/dc_offset/value", "tx_dc_cal_v0.2_", lo_freq ); } catch(const std::exception &e){ UHD_LOGGER_ERROR("CAL") << "Failure in apply_tx_fe_corrections: " << e.what(); } }
void uhd::usrp::apply_tx_fe_corrections( property_tree::sptr sub_tree, //starts at mboards/x const std::string &slot, //name of dboard slot const double lo_freq //actual lo freq ){ boost::mutex::scoped_lock l(corrections_mutex); try{ apply_fe_corrections( sub_tree, "dboards/" + slot + "/tx_eeprom", "tx_frontends/" + slot + "/iq_balance/value", "tx_iq_cal_v0.2_", lo_freq ); apply_fe_corrections( sub_tree, "dboards/" + slot + "/tx_eeprom", "tx_frontends/" + slot + "/dc_offset/value", "tx_dc_cal_v0.2_", lo_freq ); } catch(const std::exception &e){ UHD_LOGGER_ERROR("CAL") << "Failure in apply_tx_fe_corrections: " << e.what(); } }
uhd::log::severity_level _get_log_level(const std::string &log_level_str, const uhd::log::severity_level &previous_level){ if (std::isdigit(log_level_str[0])) { const uhd::log::severity_level log_level_num = uhd::log::severity_level(std::stoi(log_level_str)); if (log_level_num >= uhd::log::trace and log_level_num <= uhd::log::fatal) { return log_level_num; }else{ UHD_LOGGER_ERROR("LOG") << "Failed to set log level to: " << log_level_str; return previous_level; } } #define if_loglevel_equal(name) \ else if (log_level_str == #name) return uhd::log::name if_loglevel_equal(trace); if_loglevel_equal(debug); if_loglevel_equal(info); if_loglevel_equal(warning); if_loglevel_equal(error); if_loglevel_equal(fatal); if_loglevel_equal(off); return previous_level; }