aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/uhd_cal_rx_iq_balance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/utils/uhd_cal_rx_iq_balance.cpp')
-rw-r--r--host/utils/uhd_cal_rx_iq_balance.cpp31
1 files changed, 4 insertions, 27 deletions
diff --git a/host/utils/uhd_cal_rx_iq_balance.cpp b/host/utils/uhd_cal_rx_iq_balance.cpp
index 551da7544..3188e02a0 100644
--- a/host/utils/uhd_cal_rx_iq_balance.cpp
+++ b/host/utils/uhd_cal_rx_iq_balance.cpp
@@ -121,37 +121,14 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
if (vm.count("help")){
std::cout << boost::format("USRP Generate RX IQ Balance Calibration Table %s") % desc << std::endl;
std::cout <<
- "This application measures leakage between RX and TX on an XCVR daughterboard to self-calibrate.\n"
+ "This application measures leakage between RX and TX on a transceiver daughterboard to self-calibrate.\n"
+ "Note: Not all daughterboards support this feature. Refer to the UHD manual for details.\n"
<< std::endl;
return EXIT_FAILURE;
}
- //create a usrp device
- std::cout << std::endl;
- std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl;
- uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args);
-
- // Configure subdev
- if (vm.count("subdev")) {
- usrp->set_tx_subdev_spec(subdev);
- usrp->set_rx_subdev_spec(subdev);
- }
- UHD_MSG(status) << "Running calibration for " << usrp->get_tx_subdev_name(0) << std::endl;
- serial = get_serial(usrp, "tx");
- UHD_MSG(status) << "Daughterboard serial: " << serial << std::endl;
-
- //set the antennas to cal
- if (not uhd::has(usrp->get_rx_antennas(), "CAL") or not uhd::has(usrp->get_tx_antennas(), "CAL")){
- throw std::runtime_error("This board does not have the CAL antenna option, cannot self-calibrate.");
- }
- usrp->set_rx_antenna("CAL");
- usrp->set_tx_antenna("CAL");
-
- //fail if daughterboard has no serial
- check_for_empty_serial(usrp, "RX", "rx", args);
-
- //set optimum defaults
- set_optimum_defaults(usrp);
+ // Create a USRP device
+ uhd::usrp::multi_usrp::sptr usrp = setup_usrp_for_cal(args, subdev, serial);
//create a receive streamer
uhd::stream_args_t stream_args("fc32"); //complex floats